Given an array A of integers, find the sum of min(B), where B ranges over every (contiguous) subarray of A. Since the answer may be large, r...
Read More
Showing posts with label Competitive coding. Show all posts
Showing posts with label Competitive coding. Show all posts
Reach a Number
You are standing at 0 on an infinite number line, you have to reach the target. On each move, you can either move to the right or to left. D...
Read More
Can make palindrome from substring
We are given a string s, we make queries on it. For each query queries[i] = [left,right,x], the substring from s[left] to s[right] can be r...
Read More
Swapping adjacents in LR string
We are given a string that is composed of characters "X", "L", "R", like "XXLRXLRXXX", where L repr...
Read More
Finding number of Unique strings in wraparound string
Given a string s which is an infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look something like this: ...
Read More
Subscribe to:
Posts (Atom)
Sum of Subarray Minimums
Given an array A of integers, find the sum of min(B), where B ranges over every (contiguous) subarray of A. Since the answer may be large, r...