随笔分类 -  leetcode

摘要: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-19 23:22 lennyT 阅读(75) 评论(0) 推荐(0)
摘要:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2018-07-14 12:01 lennyT 阅读(98) 评论(0) 推荐(0)
摘要:Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1) spa 阅读全文
posted @ 2018-07-13 17:31 lennyT 阅读(157) 评论(0) 推荐(0)
摘要:Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example:Given a = 1 and b = 2, return 3. Reference: ht 阅读全文
posted @ 2018-07-09 23:05 lennyT 阅读(85) 评论(0) 推荐(0)
摘要:Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, it 阅读全文
posted @ 2018-07-07 20:38 lennyT 阅读(90) 评论(0) 推荐(0)
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文
posted @ 2018-07-07 11:35 lennyT 阅读(113) 评论(0) 推荐(0)
摘要:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i 阅读全文
posted @ 2018-07-03 23:14 lennyT 阅读(75) 评论(0) 推荐(0)
摘要:Merge Intervals--list排序后merge 阅读全文
posted @ 2018-07-01 22:50 lennyT 阅读(129) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/dengnanhua/article/details/64692191 阅读全文
posted @ 2018-07-01 22:19 lennyT 阅读(72) 评论(0) 推荐(0)