題目
We havenjobs, where every jobis scheduled to be done fromstartTime[i]toendTime[i], obtaining a profitofprofit[i].
You're given thestartTime,endTimeandprofitarrays,you need to output
題目
There are some chips, and the i-th chip is at positionchips[i].
You can perform any of the two following types of movesany number of times(possiblyzero)on any chip:
Move thei
題目
Given an array of integersarr,write a function that returnstrueif and only if the number of occurrences of each value in the array is unique.
Example 1:
Input: arr = [1,2,2,1
題目
Let's define a functionf(s)over a non-empty strings, which calculates the frequency of the smallest character ins. For example,ifs = "dcce"thenf(s) = 2because the smallest character is"
題目
Two players play a turn based game on a binary tree. We are giventherootof this binary tree, and the number of nodesnin the tree.nis odd, andeach node has a distinct value from1ton.
題目
The Tribonacci sequence Tnis defined as follows:
T0= 0, T1= 1, T2= 1, and Tn+3= Tn+ Tn+1+ Tn+2for n = 0.
Givenn, return the value of Tn.
Example 1:
Input: n = 4
Output:
題目
Given a valid (IPv4) IPaddress, return a defanged version of that IP address.
AdefangedIP addressreplaces every period"."with"[.]".
Example 1:
Input: address = "1.1.1.1"
O
題目
Given a fixed lengtharrayarrof integers, duplicate each occurrence of zero, shifting the remaining elements to the right.
Note that elements beyond the length of the original array a
題目
Given amatrix, and atarget, return the number of non-empty submatrices that sum totarget.
A submatrixx1, y1, x2, y2is the set of all cellsmatrix[y]withx1 = x = x2andy1 = y = y2.
T
題目
Given a list of words, each word consists of English lowercase letters.
Let's sayword1is a predecessor ofword2if and only if we can add exactly one letter anywhere inword1to make it
題目
Given therootof 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 sum of all keys greater than the ori
題目
Aboomerangis a set of 3 points that are all distinct andnotin a straight line.
Given a listof three points in the plane, return whether these points are a boomerang.
Example 1:
題目
We run apreorderdepth first search on therootof a binary tree.
At each node in this traversal, we outputDdashes (whereDis thedepthof this node), then we output the value of this node
題目
We are given a linked list with head as the first node. Let's number the nodes in the list: node\_1, node\_2, node\_3, ... etc.
Each node may have a next larger value: for node_i, ne
題目
Given an arrayAof0s and1s, considerN_i: the i-th subarray fromA[0]toA[i]interpretedas a binary number (from most-significant-bit to least-significant-bit.)
Return a list of booleansa
題目
A conveyor belt has1 packages that must be shipped from one port to another withinDdays.
Thei-th package on the conveyor belt has a weight ofweights[i]. Each day, we load the ship wi
題目
Given an array A of integers, we must modify the array in the following way: we choose an i and replace A[i] with -A[i], and we repeat this process K times in total. (We may choose the
題目
We are given that the string "abc" is valid.
From any valid string V, we may split V into two pieces X and Y such that X + Y (X concatenated with Y) is equal to V. (X or Y may be emp
題目
Given an array A of positive integers, call a (contiguous, not necessarily distinct) subarray of A good if the number of different integers in that subarray is exactly K.
(For exampl
題目
Given an arrayequationsof strings that represent relationships between variables, each stringequations[i]has length4and takes one of two different forms:"a==b"or"a!=b". Here,aandbare lo
題目
Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.
Example 1:
Input: [-4,-1,0,3,10]
Output: [0,1,9,16