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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Example 2: broken solution : check the boundary revision
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Examp
阅读全文
摘要: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
阅读全文
摘要:backtracking and invariant during generating the parathese righjt > left (open bracket and cloase barckst) Restore IP Addresses //insert element into
阅读全文
摘要:back function (return number) remember the structure Solution 2: dp keywards: how many ways and optimal 70. Climbing Stairs
阅读全文
摘要:using prev // 90 subset2 sorting the array first and check the contains
阅读全文
摘要:Permutation the structure of backtracking why copy the list generic list 47: duplicate elements if contains the element why both using visited array B
阅读全文
摘要: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
阅读全文
摘要:beautiful arrangement backtracking for each position check each number. set number to one position
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:https://www.lintcode.com/problem/inverted-index-map-reduce/description -- decription of the map reduce problem 1. click the submit button to view the
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Convolutional Neural Networks https://www.coursera.org/learn/convolutional-neural-networks/home/welcome There are still something confuse me! working
阅读全文
摘要:https://leetcode.com/problems/water-and-jug-problem/description/ -- 365 There are two methods to solve this problem : GCD(+ elementary number theory)
阅读全文
摘要:solution discussion https://leetcode.com/problems/kth-largest-element-in-an-array/description/ -- 215 problems https://leetcode.com/problems/kth-large
阅读全文

浙公网安备 33010602011771号