05 2018 档案

摘要: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 阅读(211) 评论(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 阅读(149) 评论(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 阅读(186) 评论(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 阅读(181) 评论(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 阅读(124) 评论(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 阅读(112) 评论(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 阅读(170) 评论(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 阅读(633) 评论(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 阅读(137) 评论(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 阅读(154) 评论(0) 推荐(0)
摘要:back function (return number) remember the structure Solution 2: dp keywards: how many ways and optimal 70. Climbing Stairs 阅读全文
posted @ 2018-05-16 12:09 wz30 阅读(124) 评论(0) 推荐(0)
摘要:using prev // 90 subset2 sorting the array first and check the contains 阅读全文
posted @ 2018-05-15 13:17 wz30 阅读(129) 评论(0) 推荐(0)
摘要:Permutation the structure of backtracking why copy the list generic list 47: duplicate elements if contains the element why both using visited array B 阅读全文
posted @ 2018-05-14 06:24 wz30 阅读(147) 评论(0) 推荐(0)
摘要:Given a binary tree, return all root-to-leaf paths. Note: A leaf is a node with no children. Example: Idea: traverse solution (inorder postorder, preo 阅读全文
posted @ 2018-05-13 14:28 wz30 阅读(246) 评论(0) 推荐(0)
摘要:beautiful arrangement backtracking for each position check each number. set number to one position 阅读全文
posted @ 2018-05-13 11:11 wz30 阅读(163) 评论(0) 推荐(0)
摘要:1. build the graph and then dfs -- graph <String, List<String>>, (the value is sorted and non- duplicate) Collections.sort(value) 2. dfs we use bottom 阅读全文
posted @ 2018-05-11 05:45 wz30 阅读(177) 评论(0) 推荐(0)
摘要:why pick the long.MIN_VALUE ? beacuse, there is case [1,2, Integer.MIN_VALUE] can not pass it with picking Integer.MIN_VALUE; Follow up what if pick t 阅读全文
posted @ 2018-05-08 01:01 wz30 阅读(138) 评论(0) 推荐(0)
摘要:https://www.lintcode.com/problem/inverted-index-map-reduce/description -- decription of the map reduce problem 1. click the submit button to view the 阅读全文
posted @ 2018-05-07 12:46 wz30 阅读(451) 评论(0) 推荐(0)
摘要:description: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, ju 阅读全文
posted @ 2018-05-03 12:40 wz30 阅读(205) 评论(0) 推荐(0)
摘要:Leetcode ugly number set (3 now) new ugly number is generated by multiplying a prime with previous generated ugly numbe Is ugly number or not //simula 阅读全文
posted @ 2018-05-03 11:53 wz30 阅读(225) 评论(0) 推荐(0)
摘要:Convolutional Neural Networks https://www.coursera.org/learn/convolutional-neural-networks/home/welcome There are still something confuse me! working 阅读全文
posted @ 2018-05-02 12:02 wz30 阅读(271) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/water-and-jug-problem/description/ -- 365 There are two methods to solve this problem : GCD(+ elementary number theory) 阅读全文
posted @ 2018-05-02 11:52 wz30 阅读(229) 评论(0) 推荐(0)
摘要:solution discussion https://leetcode.com/problems/kth-largest-element-in-an-array/description/ -- 215 problems https://leetcode.com/problems/kth-large 阅读全文
posted @ 2018-05-02 10:40 wz30 阅读(202) 评论(0) 推荐(0)