摘要: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文
posted @ 2018-05-31 23:52 wz30 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2018-05-30 05:19 wz30 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we tak 阅读全文
posted @ 2018-05-30 03:30 wz30 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Example 2: broken solution : check the boundary revision 阅读全文
posted @ 2018-05-25 12:38 wz30 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. In Pascal's trian 阅读全文
posted @ 2018-05-25 10:12 wz30 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? Solution: solve the problem with one and 阅读全文
posted @ 2018-05-25 09:43 wz30 阅读(83) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to find the number of connected 阅读全文
posted @ 2018-05-23 13:25 wz30 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Examp 阅读全文
posted @ 2018-05-23 12:32 wz30 阅读(582) 评论(0) 推荐(0) 编辑
摘要: dp or memo recursion 1. dp formulation 2. ispalindrome based on the nature structure 79. Word Search the key point is a||b||c||d; //I guess because of 阅读全文
posted @ 2018-05-19 10:38 wz30 阅读(116) 评论(0) 推荐(0) 编辑
摘要: backtracking and invariant during generating the parathese righjt > left (open bracket and cloase barckst) Restore IP Addresses //insert element into 阅读全文
posted @ 2018-05-18 12:09 wz30 阅读(123) 评论(0) 推荐(0) 编辑