摘要:
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Example 1: Input: nums = [3,2,3] Output: [3] Example 2: Input 阅读全文
摘要:
You are given the root of a binary tree with n nodes where each node in the tree has node.val coins. There are n coins in total throughout the whole t 阅读全文
摘要:
Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus 阅读全文
摘要:
You are given an array prices where prices[i] is the price of a given stock on the ith day, and an integer fee representing a transaction fee. Find th 阅读全文
摘要:
You are given an array prices where prices[i] is the price of a given stock on the ith day. Find the maximum profit you can achieve. You may complete 阅读全文
摘要:
An integer has sequential digits if and only if each digit in the number is one more than the previous digit. Return a sorted list of all the integers 阅读全文
摘要:
You are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k. Find the maximum profit you can 阅读全文
摘要:
You are given an array prices where prices[i] is the price of a given stock on the ith day. Find the maximum profit you can achieve. You may complete 阅读全文
摘要:
Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array wil 阅读全文
摘要:
On an infinite plane, a robot initially stands at (0, 0) and faces north. The robot can receive one of three instructions: "G": go straight 1 unit; "L 阅读全文
摘要:
Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a value in to_delete, we are left with a fo 阅读全文
摘要:
Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n. Example 1: Input: nums = [3,10,5,25,2,8] Output: 阅读全文
摘要:
There are n flights that are labeled from 1 to n. You are given an array of flight bookings bookings, where bookings[i] = [firsti, lasti, seatsi] repr 阅读全文
摘要:
Given a positive integer N, how many ways can we write it as a sum of consecutive positive integers? Example 1: Input: 5 Output: 2 Explanation: 5 = 5 阅读全文
摘要:
Given a node in a binary search tree, find the in-order successor of that node in the BST. If that node has no in-order successor, return null. The su 阅读全文
摘要:
Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2: Inp 阅读全文
摘要:
You are playing the Bulls and Cows game with your friend. You write down a secret number and ask your friend to guess what the number is. When your fr 阅读全文
摘要:
Given a root of an N-ary tree, return a deep copy (clone) of the tree. Each node in the n-ary tree contains a val (int) and a list (List[Node]) of its 阅读全文
摘要:
Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target. The answer is 阅读全文
摘要:
A conveyor belt has packages that must be shipped from one port to another within days days. The ith package on the conveyor belt has a weight of weig 阅读全文