Meta 45 min interview|E5
Anonymous User
1093

Q1: Determine if there’s an interval that sums to the target
[1, (3, 1, 4), 23], 8 : True (because 3 + 1 + 4 = 8)
[1, 3, 1, 4, 23], 7 : False
all integers are positive

Q2: Find non-overlapping 3 intervals of length k to maximize the sum of their elements
ar = [1 (5 8) 3 4 (7 5) 2 (5 9)], k=2 return 39 (because (5+8)+(7+5)+(5+9) = 39)

hope this help.

Comments (8)