Given an array, find the first element whose two adjacent neighbors are both strictly larger.
Given 2 arrays with the same length n, calculate the sum of absolute diff for each cyclic t-shift of nums1 with nums2. Return a list of all sums sorted in nondescending order.
Given a 2D matrix and a pattern, return the coordinate of the submatrix with the lowest row index and lowest column. The submatrix must match the pattern with the same size and the numbers should be the same; if the pattern has letters, each letter represents the same number.
Given an array of operations [1,2] [1,5] [2,3,3] [2,3,3] [2,1,1] [2,1,2], output "1010". len() == 2 means build a block on index 1; len() == 3 means check if we could build things from index 1 with the length of index 2. [1,2] builds a block at 2; [1,5] builds a block at 5; [2,3,2] checks and returns 1 as it is ok to build things on 3,4; [2,3,3] returns 0 as it is not ok to build things on 3,4,5.
Discussion
Loading comments…