![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 61
boegkpmlkvebevwa
这个作者很懒,什么都没留下…
展开
-
[LeetCode] Subsets II
Total Accepted: 8828 Total Submissions: 32877 Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: Elements in a subset must be in non-descending原创 2014-04-28 14:30:33 · 387 阅读 · 0 评论 -
[LeetCode] Binary Tree Postorder Traversal
Total Accepted: 14158 Total Submissions: 41204 Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3原创 2014-04-08 16:50:16 · 428 阅读 · 0 评论 -
[LeetCode] Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space?原创 2014-04-08 16:00:14 · 404 阅读 · 0 评论 -
[LeetCode] Pascal's Triangle
Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ]原创 2014-04-08 15:59:17 · 356 阅读 · 0 评论 -
[LeetCode] Flatten Binary Tree to Linked List
Total Accepted: 10982 Total Submissions: 40794 My Submissions原创 2014-04-22 17:41:44 · 442 阅读 · 0 评论 -
[LeetCode] Palindrome Partitioning
Total Accepted: 9269 Total Submissions: 36157 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Fo原创 2014-04-23 11:04:29 · 531 阅读 · 0 评论 -
[LeetCode] Length of Last Word
Total Accepted: 9937 Total Submissions: 35192 Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the las原创 2014-05-09 10:57:19 · 444 阅读 · 0 评论 -
[LeetCode] Binary Tree Inorder Traversa
Total Accepted: 14158 Total Submissions: 41204原创 2014-04-08 16:51:55 · 403 阅读 · 0 评论 -
[LeetCode] Binary Tree Preorder Traversal
Total Accepted: 14712 Total Submissions: 42788原创 2014-04-08 16:45:41 · 361 阅读 · 0 评论 -
[LeetCode] Linked List Cycle II
Total Accepted: 10163 Total Submissions: 33266 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space?原创 2014-04-08 16:43:08 · 337 阅读 · 0 评论 -
[LeetCode] Linked List Cycle
Total Accepted: 14403 Total Submissions: 41497 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space?原创 2014-04-08 16:26:54 · 323 阅读 · 0 评论 -
[LeetCode] Plus One
Total Accepted: 9100 Total Submissions: 29949 Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at原创 2014-04-08 16:17:36 · 313 阅读 · 0 评论 -
[LeetCode] Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with c原创 2014-04-08 15:19:40 · 311 阅读 · 0 评论 -
[LeetCode] Minimum Depth of Binary Tree
Total Accepted: 11612 Total Submissions: 39946 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le原创 2014-04-21 17:14:38 · 413 阅读 · 0 评论 -
[LeetCode] Binary Tree Level Order Traversal II
Total Accepted: 9875 Total Submissions: 31987 Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).原创 2014-05-08 11:05:52 · 370 阅读 · 0 评论 -
[LeetCode] Sort Colors
Total Accepted: 12661 Total Submissions: 40912 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order r原创 2014-05-08 09:58:30 · 430 阅读 · 0 评论 -
[LeetCode] Search in Rotated Sorted Array
Total Accepted: 11464 Total Submissions: 40857原创 2014-04-08 18:00:46 · 346 阅读 · 0 评论 -
[LeetCode] Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top public class Solution { publ原创 2014-04-08 15:20:34 · 381 阅读 · 0 评论 -
[LeetCode] Unique Paths
Total Accepted: 9992 Total Submissions: 32850 A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any poi原创 2014-04-23 12:00:42 · 357 阅读 · 0 评论 -
[LeetCode] Combinations
Total Accepted: 10516 Total Submissions: 35090原创 2014-04-28 14:59:39 · 434 阅读 · 0 评论 -
[LeetCode] Subsets
Total Accepted: 10972 Total Submissions: 40240原创 2014-04-19 21:27:59 · 1031 阅读 · 0 评论 -
[LeetCode] Permutations
Total Accepted: 12737 Total Submissions: 41350原创 2014-04-28 15:56:17 · 351 阅读 · 0 评论 -
[LeetCode] Combination Sum
Total Accepted: 9767 Total Submissions: 37455 Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat原创 2014-04-28 17:58:18 · 417 阅读 · 0 评论 -
[LeetCode] Permutations II
Total Accepted: 8649 Total Submissions: 35072原创 2014-04-28 17:28:24 · 358 阅读 · 0 评论 -
[LeetCode] 3Sum
Total Accepted: 12950 Total Submissions: 78829 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the s原创 2014-05-12 10:53:02 · 578 阅读 · 0 评论 -
[LeetCode] Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe原创 2014-05-12 11:22:14 · 408 阅读 · 0 评论 -
[LeetCode] 3Sum Closest
Total Accepted: 9118 Total Submissions: 33975 Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three intege原创 2014-05-12 10:29:42 · 414 阅读 · 0 评论 -
[LeetCode] Palindrome Partitioning II
Total Accepted: 7469 Total Submissions: 43163 Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partit原创 2014-04-24 17:55:20 · 305 阅读 · 0 评论 -
[LeetCode] Restore IP Addresses
Total Accepted: 7130 Total Submissions: 35672 Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given "25525511135", re原创 2014-04-24 18:26:53 · 406 阅读 · 0 评论 -
[LeetCode] Palindrome Number
Total Accepted: 12012 Total Submissions: 41212 Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be p原创 2014-05-09 10:50:14 · 480 阅读 · 0 评论 -
[LeetCode] Binary Tree Level Order Traversal
Total Accepted: 12041 Total Submissions: 39526 Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary原创 2014-05-08 10:29:24 · 524 阅读 · 0 评论 -
[LeetCode] Trapping Rain Water
Total Accepted: 8508 Total Submissions: 30322 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raini原创 2014-05-09 13:48:24 · 435 阅读 · 0 评论 -
[LeetCode] Rotate Image
Total Accepted: 7942 Total Submissions: 26120 You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? public cla原创 2014-04-09 18:03:03 · 389 阅读 · 0 评论 -
[LeetCode] Unique Paths II
Total Accepted: 7514 Total Submissions: 27719 Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space原创 2014-04-23 12:13:58 · 376 阅读 · 0 评论 -
[LeetCode] Remove Duplicates from Sorted Array II
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 return length = 5, and A is now [1,1,2,2,原创 2014-04-08 15:18:25 · 382 阅读 · 0 评论 -
[LeetCode] Valid Parentheses
Total Accepted: 10415 Total Submissions: 37624 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must clos原创 2014-05-07 17:58:39 · 394 阅读 · 0 评论 -
[LeetCode] N-Queens
Total Accepted: 7379 Total Submissions: 29099原创 2014-05-04 17:54:20 · 683 阅读 · 0 评论 -
[LeetCode] Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. /** * Definition f原创 2014-04-02 15:52:51 · 401 阅读 · 0 评论 -
[LeetCode] Remove Element
Total Accepted: 11381 Total Submissions: 35254 Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't mat原创 2014-04-02 15:42:42 · 323 阅读 · 0 评论 -
[LeetCode] Maximum Subarray
Total Accepted: 11866 Total Submissions: 36548 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,1原创 2014-04-02 15:33:27 · 527 阅读 · 0 评论