摘要: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Example: Input: 阅读全文
posted @ 2018-07-23 18:18 Lin.B 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 今天总结一下用Floyd算法来判断链表中是否有环,如果有环,如何找到环的入口。这一系列问题。 1、Linked List Cycle Ⅰ Given a linked list, determine if it has a cycle in it. Follow up:Can you solve i 阅读全文
posted @ 2018-07-23 17:28 Lin.B 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2018-07-23 16:23 Lin.B 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 今天来总结一下Missing Number一系列问题 1、Find All Numbers Disappeared in an Array Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements 阅读全文
posted @ 2018-07-23 15:54 Lin.B 阅读(232) 评论(0) 推荐(0) 编辑