随笔分类 -  LeetCode

摘要:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2016-05-18 11:10 no_one 阅读(124) 评论(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-05-18 10:21 no_one 阅读(123) 评论(0) 推荐(0)
摘要:Follow up for ”Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted array A = [1,1,1,2,2,3],Your function should 阅读全文
posted @ 2016-05-17 10:39 no_one 阅读(111) 评论(0) 推荐(0)
摘要:Given a sorted array, remove the duplicates in place such that each element appear only onceand return the new length.Do not allocate extra space for 阅读全文
posted @ 2016-05-17 09:23 no_one 阅读(105) 评论(0) 推荐(0)
摘要:描述Given a string containing just the characters ’(’ and ’)’, find the length of the longest valid (wellformed)parentheses substring.For ”(()”, the lon 阅读全文
posted @ 2016-05-16 14:24 no_one 阅读(95) 评论(0) 推荐(0)
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2016-05-15 21:35 no_one 阅读(141) 评论(0) 推荐(0)