![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
csu54zzg
这个作者很懒,什么都没留下…
展开
-
Posts Tagged 【list】Reverse Linked List
Reverse Linked List Total Accepted: 4127 Total Submissions: 11587My Submissions Question Solution Reverse a singly linked list. /** * Definition for singly-linked list. * publi原创 2015-05-07 10:18:23 · 390 阅读 · 0 评论 -
Posts Tagged 【bfs】Binary Tree Level Order Traversal I && II
Binary Tree Level Order Traversal Total Accepted: 47754 Total Submissions: 161177My Submissions Question Solution Given a binary tree, return the level order traversal of its node原创 2015-04-26 22:21:02 · 355 阅读 · 0 评论 -
Posts Tagged 【String】 Text Justification
Text Justification Total Accepted: 18124 Total Submissions: 125685My Submissions Question Solution Given an array of words and a length L, format the text such that each line has原创 2015-04-30 16:02:52 · 524 阅读 · 0 评论 -
Posts Tagged 【List】Swap Nodes in Pairs
Swap Nodes in Pairs Total Accepted: 45650 Total Submissions: 140545My Submissions Question Solution Given a linked list, swap every two adjacent nodes and return its head. For ex原创 2015-04-30 16:30:50 · 363 阅读 · 0 评论 -
Posts Tagged 【math】Valid Sudoku
Valid Sudoku Total Accepted: 33528 Total Submissions: 122751My Submissions Question Solution Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku原创 2015-05-02 15:22:50 · 344 阅读 · 0 评论 -
Posts Tagged 【math】Count Primes
Count Primes Total Accepted: 3 Total Submissions: 73My Submissions Question Solution Description: Count the number of prime numbers less than a non-negative number, n Hint: The原创 2015-04-27 12:50:40 · 486 阅读 · 0 评论 -
Posts Tagged 【math】Max Points on a Line
Max Points on a Line Total Accepted: 35386 Total Submissions: 287709My Submissions Question Solution Given n points on a 2D plane, find the maximum number of points that lie on th原创 2015-05-02 15:17:26 · 470 阅读 · 0 评论 -
Posts Tagged 【List】Remove Linked List Elements
Remove Linked List Elements Total Accepted: 4504 Total Submissions: 16723My Submissions Question Solution Remove all elements from a linked list of integers that have value val.原创 2015-04-27 13:02:30 · 338 阅读 · 0 评论 -
Posts Tagged 【math】Happy Number
Happy Number Total Accepted: 4647 Total Submissions: 14429My Submissions Question Solution Write an algorithm to determine if a number is "happy". A happy number is a number defi原创 2015-04-27 13:46:01 · 418 阅读 · 0 评论 -
Posts Tagged 【bit】Number of 1 Bits
Number of 1 Bits Total Accepted: 24515 Total Submissions: 66387My Submissions Question Solution Write a function that takes an unsigned integer and returns the number of ’1' bits原创 2015-04-27 15:37:39 · 322 阅读 · 0 评论 -
Posts Tagged 【bfs】Maximum && Minimum Depth of Binary Tree
Maximum Depth of Binary Tree Total Accepted: 62009 Total Submissions: 137555My Submissions Question Solution Given a binary tree, find its maximum depth. The maximum depth is the原创 2015-04-30 19:14:49 · 441 阅读 · 0 评论 -
Posts Tagged 【bit】Reverse Bits
Reverse Bits Total Accepted: 17853 Total Submissions: 64347My Submissions Question Solution Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (r原创 2015-04-27 23:54:27 · 344 阅读 · 0 评论 -
Posts Tagged 【hashMap && Double Linked List】LRU Cache
LRU Cache Total Accepted: 37708 Total Submissions: 253143My Submissions Question Solution Design and implement a data structure for Least Recently Used (LRU) cache. It should supp原创 2015-05-06 22:51:38 · 797 阅读 · 0 评论 -
Posts Tagged 【array && sort】Merge Intervals
Merge Intervals Total Accepted: 33631 Total Submissions: 150861My Submissions Question Solution Given a collection of intervals, merge all overlapping intervals. For example, Gi原创 2015-05-05 23:34:11 · 317 阅读 · 0 评论 -
Posts Tagged 【List】Anagrams
Anagrams Total Accepted: 34386 Total Submissions: 141041My Submissions Question Solution Given an array of strings, return all groups of strings that are anagrams. Note: All inpu原创 2015-05-02 00:00:26 · 389 阅读 · 0 评论 -
Posts Tagged 【list && tree && dfs】Flatten Binary Tree to Linked List
Flatten Binary Tree to Linked List Total Accepted: 45579 Total Submissions: 158362My Submissions Question Solution Given a binary tree, flatten it to a linked list in-place. For原创 2015-05-05 10:11:27 · 373 阅读 · 0 评论 -
Posts Tagged 【tree && dfs】Sum Root to Leaf Numbers
Sum Root to Leaf Numbers Total Accepted: 42534 Total Submissions: 140130My Submissions Question Solution Given a binary tree containing digits from 0-9 only, each root-to-leaf p原创 2015-05-01 14:01:34 · 441 阅读 · 0 评论 -
Posts Tagged 【math】Sudoku Solver
Sudoku Solver Total Accepted: 26308 Total Submissions: 121888My Submissions Question Solution Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are原创 2015-05-02 23:11:29 · 395 阅读 · 0 评论 -
Posts Tagged 【String】 Isomorphic Strings
Isomorphic Strings Total Accepted: 2968 Total Submissions: 11949My Submissions Question Solution Given two strings s and t, determine if they are isomorphic. Two strings are isom原创 2015-05-01 21:52:51 · 445 阅读 · 0 评论 -
Posts Tagged 【tree && dfs】
Same Tree Total Accepted: 56272 Total Submissions: 133925My Submissions Question Solution Given two binary trees, write a function to check if they are equal or not. Two binary t原创 2015-04-14 11:51:17 · 372 阅读 · 0 评论 -
Posts Tagged 【Catalan && dfs】Unique Binary Search Trees I && II
Unique Binary Search Trees Total Accepted: 47048 Total Submissions: 129376My Submissions Question Solution Given n, how many structurally unique BST's (binary search trees) that s原创 2015-05-01 10:54:33 · 450 阅读 · 0 评论 -
Posts Tagged 【bit】Bitwise AND of Numbers Range
Bitwise AND of Numbers Range Total Accepted: 5165 Total Submissions: 19617My Submissions Question Solution Given a range [m, n] where 0 For example, given the range [5, 7], you原创 2015-04-27 15:33:38 · 441 阅读 · 0 评论 -
Posts Tagged 【dp】Climbing Stairs
Climbing Stairs Total Accepted: 50798 Total Submissions: 148662My Submissions Question Solution You are climbing a stair case. It takes n steps to reach to the top. Each time you原创 2015-04-29 20:46:00 · 312 阅读 · 0 评论 -
Posts Tagged 【String】 Reverse Words in a String
Reverse Words in a String Total Accepted: 60944 Total Submissions: 406484My Submissions Question Solution Given an input string, reverse the string word by word. For example, Gi原创 2015-04-25 18:38:08 · 328 阅读 · 0 评论 -
Posts Tagged 【String】
Excel Sheet Column Title Total Accepted: 21824 Total Submissions: 122722My Submissions Question Solution Given a positive integer, return its corresponding column title as appear原创 2015-04-15 21:04:05 · 345 阅读 · 0 评论 -
Posts Tagged 【dp】Jump Game II
Jump Game II Total Accepted: 34513 Total Submissions: 141130My Submissions Question Solution Given an array of non-negative integers, you are initially positioned at the first ind原创 2015-04-12 23:29:11 · 322 阅读 · 0 评论 -
Posts Tagged 【Arrays】Insert Interval
Insert Interval Total Accepted: 30456 Total Submissions: 143835My Submissions Question Solution Given a set of non-overlapping intervals, insert a new interval into the intervals原创 2015-04-23 22:55:20 · 290 阅读 · 0 评论 -
Simplify Path
Simplify Path Total Accepted: 25684 Total Submissions: 128167My Submissions Question Solution Given an absolute path for a file (Unix-style), simplify it. For example, path = "/原创 2015-04-13 13:06:04 · 320 阅读 · 0 评论 -
Add Binary
Add Binary Total Accepted: 38531 Total Submissions: 155087My Submissions Question Solution Given two binary strings, return their sum (also a binary string). For example, a = "1原创 2015-04-13 14:44:25 · 294 阅读 · 0 评论 -
Permutation Sequence
Permutation Sequence Total Accepted: 27012 Total Submissions: 118954My Submissions Question Solution The set [1,2,3,…,n] contains a total of n! unique permutations. By listing原创 2015-04-12 11:39:33 · 496 阅读 · 0 评论 -
Reverse Linked List II
Reverse Linked List II Total Accepted: 36085 Total Submissions: 137566My Submissions Question Solution Reverse a linked list from position m to n. Do it in-place and in one-pass.原创 2015-04-07 19:31:29 · 255 阅读 · 0 评论 -
Posts Tagged 【fsm】 Valid Number
Valid Number Total Accepted: 24695 Total Submissions: 216249My Submissions Question Solution Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true原创 2015-04-19 18:35:41 · 681 阅读 · 0 评论 -
Posts Tagged 【dp】Interleaving String
Interleaving String Total Accepted: 29109 Total Submissions: 141918My Submissions Question Solution Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.原创 2015-04-22 19:24:34 · 328 阅读 · 0 评论 -
Posts Tagged 【List 】Reorder List
Reorder List Total Accepted: 37888 Total Submissions: 180454My Submissions Question Solution Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…原创 2015-04-23 23:50:57 · 415 阅读 · 0 评论 -
Posts Tagged 【Array】
Set Matrix Zeroes Total Accepted: 33316 Total Submissions: 105958My Submissions Question Solution Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do原创 2015-04-16 13:41:47 · 335 阅读 · 0 评论 -
Posts Tagged 【dfs】Restore IP Addresses
Restore IP Addresses Total Accepted: 30274 Total Submissions: 145054My Submissions Question Solution Given a string containing only digits, restore it by returning all possible va原创 2015-04-25 15:11:33 · 387 阅读 · 0 评论 -
Posts Tagged 【dfs】Number of Islands
Number of Islands Total Accepted: 5548 Total Submissions: 26482My Submissions Question Solution Given a 2d grid map of '1's (land) and '0's (water), count the number of islands.原创 2015-04-26 23:56:52 · 381 阅读 · 0 评论 -
Posts Tagged 【dfs】Generate Parentheses
Generate Parentheses Total Accepted: 41747 Total Submissions: 128780My Submissions Question Solution Given n pairs of parentheses, write a function to generate all combinations of原创 2015-04-20 22:03:37 · 457 阅读 · 0 评论 -
Posts Tagged 【Search】
Find Minimum in Rotated Sorted Array Total Accepted: 38231 Total Submissions: 115773My Submissions Question Solution Suppose a sorted array is rotated at some pivot unknown to you原创 2015-04-16 17:32:11 · 392 阅读 · 0 评论 -
Posts Tagged 【Math】
Divide Two Integers Total Accepted: 34460 Total Submissions: 225991My Submissions Question Solution Divide two integers without using multiplication, division and mod operator. I原创 2015-04-16 23:11:02 · 361 阅读 · 0 评论