摘要: 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 @ 2016-12-16 12:04 lettuan 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 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. For example, giv 阅读全文
posted @ 2016-12-16 10:21 lettuan 阅读(85) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. 阅读全文
posted @ 2016-12-16 06:42 lettuan 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed n 阅读全文
posted @ 2016-12-16 06:04 lettuan 阅读(120) 评论(0) 推荐(0) 编辑
摘要: After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This t 阅读全文
posted @ 2016-12-16 05:22 lettuan 阅读(187) 评论(0) 推荐(0) 编辑