Company: Corridor Platforms
Difficulty: medium
Maximize k for A[i] > B[i] Problem Description Given two arrays A and B of size N . You can rearrange elements of A as you wish. Find the maximum value of k , where k is the number of indices i satisfying A[i] > B[i] . Constraints N A[i], B[i] Sum of Lengths of Lexicographically Smallest Substrings Problem Description Given a string S of size N , and Q queries of strings. For each query, find the length of the lexicographically smallest substring of S that starts with the query string T . Return the value of the sum of lengths of all such substrings. Constraints N Q T.length() Largest Term in Sum of First N Numbers Smaller Than T Problem Description Given a sequence of the sum of the first n numbers (i.e., triangular numbers 1, 3, 6, 10, ...), what is the largest term in that sequence that is smaller than a given value T ? Constraints Constraints are not explicitly mentioned in the problem statement. Minimum Swaps to Group Same Numbers Problem Description Find the minimum number of swa