上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 描述 Given an array of integers and an integer k, you need to find the number of unique k diff pairs in the array. Here a k diff pair is defined as an i 阅读全文
posted @ 2017-04-27 16:54 larryking 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 描述 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [ 2,1, 3,4, 1 阅读全文
posted @ 2017-04-27 16:32 larryking 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 描述 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 分析 有序 阅读全文
posted @ 2017-04-25 16:09 larryking 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 描述 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in 阅读全文
posted @ 2017-04-25 16:09 larryking 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 描述 Implement strStr(). Returns the index of the first occurrence of needle in haystack, or 1 if needle is not part of haystack. 分析 设置一个索引index,初始化为0,用 阅读全文
posted @ 2017-04-25 16:08 larryking 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 描述 Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, y 阅读全文
posted @ 2017-04-23 16:04 larryking 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 描述 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in t 阅读全文
posted @ 2017-04-23 15:59 larryking 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 描述 Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1 1 2, return 1 2. Given 1 1 2 3 3, r 阅读全文
posted @ 2017-04-23 15:58 larryking 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 描述 Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The l 阅读全文
posted @ 2017-04-23 15:57 larryking 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 描述 Follow up for ”Search in Rotated Sorted Array”: What if duplicates are allowed? Would this affect the run time complexity? How and why? Write a fun 阅读全文
posted @ 2017-04-20 19:12 larryking 阅读(130) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页