LeetCode(100)题解--Same Tree
摘要:https://leetcode.com/problems/same-tree/ 题目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are consider
阅读全文
LeetCode(16)题解--3Sum Closest
摘要:https://leetcode.com/problems/3sum-closest/ 题目: Given an array S of n integers, find three integers in S such that the sum is closest to a given numbe
阅读全文
LeetCode(15)题解--3Sum
摘要:https://leetcode.com/problems/3sum/ 题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique tripl
阅读全文
LeetCode(125)题解--Valid Palindrome
摘要:https://leetcode.com/problems/valid-palindrome/ 题目: Given a string, determine if it is a palindrome, considering only alphanumeric characters and igno
阅读全文
LeetCode(155)题解--Min Stack
摘要:https://leetcode.com/problems/min-stack/ 题目: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x)
阅读全文
LeetCode(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. Not
阅读全文
LeetCode(82)题解: Remove Duplicates from Sorted List II
摘要:https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/ 题目: Given a sorted linked list, delete all nodes that have duplicate numbers, lea
阅读全文
LeetCode(83)题解: Remove Duplicates from Sorted List
摘要:https://leetcode.com/problems/remove-duplicates-from-sorted-list/ 题目: Given a sorted linked list, delete all duplicates such that each element appear
阅读全文
LeetCode(70)题解: climbing-stairs
摘要:https://leetcode.com/problems/climbing-stairs/ 题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb
阅读全文
LeetCode(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 "10
阅读全文
LeetCode(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 stor
阅读全文
Leetcode(58)题解:Length of Last Word
摘要:https://leetcode.com/problems/length-of-last-word/ 题目: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return
阅读全文
LeetCode(38)题解: Count and Say
摘要:https://leetcode.com/problems/count-and-say/ 题目: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221,
阅读全文
LeetCode(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 coordinat
阅读全文
LeetCode(3)题解: Longest Palindromic Substring
摘要:https://leetcode.com/problems/longest-palindromic-substring/ 题目: Given a string S, find the longest palindromic substring in S. You may assume that th
阅读全文
LeetCode(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 need
阅读全文
LeetCode(27)题解:Remove Element
摘要:https://leetcode.com/problems/remove-element/ Given an array and a value, remove all instances of that value in place and return the new length. The o
阅读全文
LeetCode(26)题解:Remove Duplicates from Sorted Array
摘要:https://leetcode.com/problems/remove-duplicates-from-sorted-array/ Given a sorted array, remove the duplicates in place such that each element appear
阅读全文
LeetCode(21)题解:Merge Two Sorted Lists
摘要:https://leetcode.com/problems/merge-two-sorted-lists/ Merge two sorted linked lists and return it as a new list. The new list should be made by splici
阅读全文
LeetCode题解(20)--Valid Parentheses
摘要:https://leetcode.com/problems/valid-parentheses/ 原题: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the i
阅读全文
|
|
|