随笔分类 - leetcode
https://leetcode.com/problemset/all/
摘要:Given a string containing digits from 2 9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le
阅读全文
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 1.
阅读全文
摘要:Implement strStr(). Return the index of the first occurrence of needle in haystack, or 1 if needle is not part of haystack. Example 1: Input: haystack
阅读全文
摘要:Alice and Bob have candy bars of different sizes: A[i] is the size of the i th bar of candy that Alice has, and B[j] is the size of the j th bar of ca
阅读全文
摘要:Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl
阅读全文
摘要:Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1 2 Output: false Example 2: Input: 1 2 2 1 Output: true Follow up: Cou
阅读全文
摘要:Given a non negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. In Pascal's trian
阅读全文
摘要:Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Input: [1,3,null,null,2
阅读全文
摘要:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet
阅读全文
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height balanced binary tree is d
阅读全文
摘要:Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" Output: true Example
阅读全文
摘要:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston
阅读全文
摘要:Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given t
阅读全文
摘要:You are given a data structure of employee information, which includes the employee's unique id, his importance value and his direct subordinates' id.
阅读全文
摘要:Given a tree, rearrange the tree in in order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and o
阅读全文
摘要:An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i = A[j]. Return true i
阅读全文
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n
阅读全文
摘要:We are given two sentences A and B. (A sentence is a string of space separated words. Each word consists only of lowercase letters.) A word is uncommo
阅读全文
摘要:Given a binary tree struct TreeLinkNode { TreeLinkNode left; TreeLinkNode right; TreeLinkNode next; } Populate each next pointer to point to its next
阅读全文
摘要:Given a binary tree struct TreeLinkNode { TreeLinkNode left; TreeLinkNode right; TreeLinkNode next; } Populate each next pointer to point to its next
阅读全文

浙公网安备 33010602011771号