随笔分类 -  LeetCode

上一页 1 2 3 4 5 6 7 ··· 14 下一页
摘要:Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Example 2: 使用K 阅读全文
posted @ 2018-03-11 12:52 immjc 阅读(135) 评论(0) 推荐(0)
摘要:Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected e 阅读全文
posted @ 2018-03-07 22:52 immjc 阅读(127) 评论(0) 推荐(0)
摘要:Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible stri 阅读全文
posted @ 2018-03-05 17:37 immjc 阅读(189) 评论(0) 推荐(0)
摘要:Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Exa 阅读全文
posted @ 2018-02-11 13:57 immjc 阅读(132) 评论(0) 推荐(0)
摘要:Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values 阅读全文
posted @ 2018-02-09 12:21 immjc 阅读(123) 评论(0) 推荐(0)
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup 阅读全文
posted @ 2018-02-09 11:56 immjc 阅读(119) 评论(0) 推荐(0)
摘要:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements 阅读全文
posted @ 2018-02-05 16:43 immjc 阅读(103) 评论(0) 推荐(0)
摘要:Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temp 阅读全文
posted @ 2018-02-01 22:03 immjc 阅读(183) 评论(0) 推荐(0)
摘要:You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in Sis a type of stone 阅读全文
posted @ 2018-01-29 15:37 immjc 阅读(452) 评论(0) 推荐(0)
摘要:Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following unique pe 阅读全文
posted @ 2018-01-26 13:28 immjc 阅读(101) 评论(0) 推荐(0)
摘要:Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not conta 阅读全文
posted @ 2018-01-25 22:51 immjc 阅读(82) 评论(0) 推荐(0)
摘要:Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. For ex 阅读全文
posted @ 2018-01-25 22:28 immjc 阅读(102) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each num 阅读全文
posted @ 2018-01-25 22:07 immjc 阅读(131) 评论(0) 推荐(0)
摘要:Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums 阅读全文
posted @ 2018-01-25 21:51 immjc 阅读(124) 评论(0) 推荐(0)
摘要:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is: [ [2,4], [3,4 阅读全文
posted @ 2018-01-25 21:37 immjc 阅读(102) 评论(0) 推荐(0)
摘要:Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of t 阅读全文
posted @ 2018-01-24 21:35 immjc 阅读(128) 评论(0) 推荐(0)
摘要:A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, return True if and only if the m 阅读全文
posted @ 2018-01-22 10:21 immjc 阅读(336) 评论(0) 推荐(0)
摘要:A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2018-01-21 11:31 immjc 阅读(138) 评论(0) 推荐(0)
摘要:Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any 阅读全文
posted @ 2018-01-21 10:18 immjc 阅读(140) 评论(0) 推荐(0)
摘要:You need to find the largest value in each row of a binary tree. Example: Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9] You need to find the largest 阅读全文
posted @ 2018-01-20 15:57 immjc 阅读(152) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 ··· 14 下一页