Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find th…
分类:LeetCode题目解答
[LeetCode] Swap Adjacent in LR String 交换LR字符串中的相邻项
In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move…
【leetcode】33. Search in Rotated Sorted Array 循环有序数组的二分查找
1. 题目 Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might be…
142. Linked List Cycle II
欢迎fork and star:Nowcoder-Repository-github 142. Linked List Cycle II 题目 Given a linked list, return the node w…
[LeetCode] Boundary of Binary Tree 二叉树的边界
Given a binary tree, return the values of its boundary in anti-clockwise direction starting f…
LeetCode | Best Time to Buy and Sell Stock
题目: Say you have an array for which the ith element is the price of a given stock on day i. If …
LeetCode 77. Combinations
Given two integers n and k, return all possible combinations of k numbers out of 1 … n. For example,If n…
[LeetCode] Remove Duplicates from Sorted Array II 有序数组中去除重复项之二
Follow up for “Remove Duplicates”:What if duplicates are allowed at most twice? For ex…
[LeetCode] Maximum Swap 最大置换
Given a non-negative integer, you could swap two digits at most once to get the maximum value…
[LeetCode] Max Chunks To Make Sorted II 可排序的最大块数之二
This question is the same as “Max Chunks to Make Sorted” except the integers of the given a…
[Leetcode] Verify Preorder Sequence in Binary Search Tree 验证先序序列
Verify Preorder Sequence in Binary Search Tree Given an array of numbers, verify whether it is the correct pre…
27. Remove Element
27. Remove Element 题目 Given an array and a value, remove all instances of that value in-place and return the n…