1. 题目 Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its…
分类:LeetCode题目解答
[LeetCode] Search Insert Position 搜索插入位置
Given a sorted array and a target value, return the index if the target is found. If not, return the in…
[LeetCode] Valid Anagram 验证变位词,Minimum Window Substring 最小窗口子串,Isomorphic Strings 同构字符串,Longest Substring Without Repeating Characters 最长无重复子串,1.1 Unique Characters of a String 字符串中不同的字符
Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = R…
LeetCode 278. First Bad Version
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest ver…
[LeetCode] Shortest Distance from All Buildings 建筑物的最短距离
You want to build a house on an empty land which reaches all buildings in the shortest amount…
LeetCode | Combinations
题目: Given two integers n and k, return all possible combinations of k numbers out of …
LeetCode | Interleaving String
题目: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 a…
LeetCode | Partition List
题目: Given a linked list and a value x, partition it such that all nodes less than x come before…
LeetCode 073 Set Matrix Zeroes
题目描述 Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click to sh…
【Leetcode】16. 3Sum Closest 集合中选三个元素之和最接近指定值
1. 题目 Given an array S of n integers, find three integers in S such that the sum is closest to a given number,…
LeetCode 202 Happy Number
题目描述 Write an algorithm to determine if a number is “happy”. A happy number is a number defined by the followi…
1002. Find Common Characters
Given an array A of strings made only from lowercase letters, return a list of all characters that show up in …