leetcode
文章平均质量分 52
不行就重启
这个作者很懒,什么都没留下…
展开
-
223 Rectangle Area
223 Rectangle Area链接:https://leetcode.com/problems/rectangle-area/ 问题描述: Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner原创 2015-06-30 15:45:09 · 426 阅读 · 0 评论 -
219 Contains Duplicate II
219 Contains Duplicate II链接:https://leetcode.com/problems/contains-duplicate-ii/ 问题描述: Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in原创 2015-07-09 22:31:08 · 395 阅读 · 0 评论 -
30 Substring with Concatenation of All Words
30 Substring with Concatenation of All Words链接:https://leetcode.com/tag/hash-table/ 问题描述: You are given a string, s, and a list of words, words, that are all of the same length. Find all starting ind原创 2015-07-09 13:19:26 · 335 阅读 · 0 评论 -
136 Single Number
136 Single Number链接:https://leetcode.com/problems/single-number/ 问题描述: Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should hav原创 2015-07-09 13:52:42 · 457 阅读 · 0 评论 -
151 Reverse Words in a String
151 Reverse Words in a String链接:https://leetcode.com/problems/reverse-words-in-a-string/ 问题描述: Given an input string, reverse the string word by word.For example, Given s = “the sky is blue”, re原创 2015-05-25 18:34:14 · 274 阅读 · 0 评论 -
150 Evaluate Reverse Polish Notation
150 Evaluate Reverse Polish Notation链接:https://leetcode.com/problems/evaluate-reverse-polish-notation/ 问题描述:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators原创 2015-05-25 19:51:08 · 194 阅读 · 0 评论 -
76 Minimum Window Substring
76 Minimum Window Substring链接:https://leetcode.com/problems/minimum-window-substring/ 问题描述: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in原创 2015-07-09 21:37:42 · 518 阅读 · 0 评论 -
94 Binary Tree Inorder Traversal
链接:https://leetcode.com/problems/binary-tree-inorder-traversal/ 问题描述: Given a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, 1 \原创 2015-07-10 09:52:12 · 371 阅读 · 0 评论 -
29 Divide Two Integers
29 Divide Two Integers链接:https://leetcode.com/problems/divide-two-integers/ 问题描述: Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Hide T原创 2015-07-01 20:23:31 · 346 阅读 · 0 评论 -
8 String to Integer (atoi)
8 String to Integer (atoi)链接:https://leetcode.com/problems/string-to-integer-atoi/ 问题描述: Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you wa原创 2015-07-03 13:20:42 · 447 阅读 · 0 评论 -
43 Multiply Strings
43 Multiply Strings链接:https://leetcode.com/problems/multiply-strings/ 问题描述: Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitra原创 2015-07-01 17:56:22 · 355 阅读 · 0 评论 -
217 Contains Duplicate
217 Contains Duplicate链接:https://leetcode.com/problems/contains-duplicate/ 问题描述: Given an array of integers, find if the array contains any duplicates. Your function should return true if any valu原创 2015-07-09 22:09:29 · 341 阅读 · 0 评论 -
3 Longest Substring Without Repeating Characters
3 Longest Substring Without Repeating Characters链接:https://leetcode.com/problems/longest-substring-without-repeating-characters/ 问题描述: Given a string, find the length of the longest substring withou原创 2015-07-09 22:03:20 · 311 阅读 · 0 评论 -
1 Two Sum
1 Two Sum链接:https://leetcode.com/problems/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 t原创 2015-07-08 13:31:50 · 441 阅读 · 0 评论 -
36 Valid Sudoku
36 Valid Sudoku链接:https://leetcode.com/problems/valid-sudoku/ 问题描述: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty ce原创 2015-07-08 16:22:43 · 521 阅读 · 0 评论 -
60 Permutation Sequence
60 Permutation Sequence链接:https://leetcode.com/problems/permutation-sequence/ 问题描述: The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in o原创 2015-07-01 15:21:15 · 582 阅读 · 0 评论 -
9 Palindrome Number
9 Palindrome Number链接:https://leetcode.com/problems/palindrome-number/ 问题描述: Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints: Could negat原创 2015-07-01 16:01:34 · 342 阅读 · 0 评论 -
50 Pow(x, n)
50 Pow(x, n)链接:https://leetcode.com/problems/powx-n/ 问题描述: Implement pow(x, n).Hide Tags Math Binary Search实现pow函数。这个问题可以用递归解决,联想到到 Binary Search,我的解决方案是每次让指数缩小两倍,当指数为技术的时候需要特别处理。还有指数为负的情况需要注意。class原创 2015-07-01 00:20:39 · 575 阅读 · 0 评论 -
66 Plus One
66 Plus One链接:https://leetcode.com/problems/plus-one/ 问题描述: 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原创 2015-07-01 12:36:34 · 392 阅读 · 0 评论 -
37 Sudoku Solver
37 Sudoku Solver链接:https://leetcode.com/problems/sudoku-solver/ 问题描述: Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character ‘.’.You may assume原创 2015-07-08 22:31:22 · 359 阅读 · 0 评论 -
224 Basic Calculator
224 Basic Calculator链接:https://leetcode.com/problems/basic-calculator/ 问题描述: Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closin原创 2015-07-01 23:43:26 · 421 阅读 · 0 评论 -
154 Find Minimum in Rotated Sorted Array II
154 Find Minimum in Rotated Sorted Array II链接:https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/ 问题描述:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(原创 2015-05-25 15:39:27 · 229 阅读 · 0 评论 -
67 Add Binary
67 Add Binary链接:https://leetcode.com/problems/add-binary/ 问题描述: Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.Hide Tags Math String求两原创 2015-07-03 01:26:12 · 472 阅读 · 0 评论 -
227 Basic Calculator II
227 Basic Calculator II链接:https://leetcode.com/problems/basic-calculator-ii/ 问题描述: Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negat原创 2015-07-01 23:40:41 · 528 阅读 · 0 评论 -
49 Anagrams
49 Anagrams链接:https://leetcode.com/problems/anagrams/ 问题描述: Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.Hide Tags Hash Table Strin原创 2015-07-10 12:09:16 · 390 阅读 · 0 评论 -
20 Valid Parentheses
20 Valid Parentheses链接:https://leetcode.com/problems/valid-parentheses/ 问题描述: Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The原创 2015-07-11 02:51:26 · 354 阅读 · 0 评论 -
88 Merge Sorted Array
88 Merge Sorted Array链接:https://leetcode.com/problems/merge-sorted-array/ 问题描述: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that原创 2015-07-14 23:55:14 · 328 阅读 · 0 评论 -
28 Implement strStr()
链接:https://leetcode.com/problems/implement-strstr/ 问题描述: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02原创 2015-07-15 02:22:32 · 362 阅读 · 0 评论 -
234 Palindrome Linked List
234 Palindrome Linked List链接:https://leetcode.com/problems/palindrome-linked-list/ 问题描述: Given a singly linked list, determine if it is a palindrome.Follow up: Could you do it in O(n) time and O(原创 2015-07-14 16:22:23 · 605 阅读 · 0 评论 -
11 Container With Most Water
链接:https://leetcode.com/problems/container-with-most-water/ 问题描述: Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such tha原创 2015-07-15 02:48:40 · 337 阅读 · 0 评论 -
6 ZigZag Conversion
链接:https://leetcode.com/problems/zigzag-conversion/ 问题描述: The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fi原创 2015-07-15 21:30:18 · 323 阅读 · 0 评论 -
44 Wildcard Matching
44 Wildcard Matching链接:https://leetcode.com/problems/wildcard-matching/ 问题描述: Implement wildcard pattern matching with support for ‘?’ and ‘*’.'?' Matches any single character.'*' Matches any sequen原创 2015-07-16 11:10:23 · 530 阅读 · 0 评论 -
101 Symmetric Tree
101 Symmetric Tree链接:https://leetcode.com/problems/symmetric-tree/ 问题描述: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree原创 2015-08-19 03:51:30 · 499 阅读 · 0 评论 -
129 Sum Root to Leaf Numbers
129 Sum Root to Leaf Numbers链接:https://leetcode.com/problems/sum-root-to-leaf-numbers/ 问题描述: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An原创 2015-08-19 04:07:41 · 479 阅读 · 0 评论 -
98 Validate Binary Search Tree
98 Validate Binary Search Tree链接:https://leetcode.com/problems/validate-binary-search-tree/ 问题描述: Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as原创 2015-08-19 00:58:18 · 638 阅读 · 0 评论 -
96 Unique Binary Search Trees
96 Unique Binary Search Trees链接:https://leetcode.com/problems/unique-binary-search-trees/ 问题描述: Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example, G原创 2015-08-19 01:56:01 · 547 阅读 · 0 评论 -
231 Power of Two
231 Power of Two链接:https://leetcode.com/problems/power-of-two/ 问题描述: Given an integer, write a function to determine if it is a power of two.Credits: Special thanks to @jianchao.li.fighter for ad原创 2015-07-07 15:24:34 · 358 阅读 · 0 评论 -
80 Remove Duplicates from Sorted Array II
80 Remove Duplicates from Sorted Array II链接:https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/ 问题描述: Follow up for “Remove Duplicates”: What if duplicates are allowed at most twic原创 2015-07-14 14:48:29 · 443 阅读 · 0 评论 -
18 4Sum
18 4Sum链接:https://leetcode.com/problems/4sum/ 问题描述: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array w原创 2015-07-13 00:32:25 · 286 阅读 · 0 评论 -
209 Minimum Size Subarray Sum
链接:https://leetcode.com/problems/minimum-size-subarray-sum/ 问题描述: Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there原创 2015-07-14 23:06:51 · 338 阅读 · 0 评论