Given an array and an integer k, find the minimum number of elements you must take only from the two ends (left or right, repeatedly) so that their sum equals k. Return -1 if it is impossible…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.