Amazon OA
Anonymous User
2524

Question 1:
Find the all numbers in maximum intersections for given intervals.
Ex:[[1,5],[5,10],[5,5]]:
the maximum intersection is [5,5] and there's only 1 number in it so answer is 1.

Ex[[1,2],[3,5]]
no intersection and the answer is all numbers between 1 and 5, including boundaries, which is 5.

Question 2:
Find total number of unique characters in all substrings of a given string.
Ex:
"og": 1 for "g", 1 for "o" and 2 for "og". 4 is total number

I tried merging intervals for question 1 and dp for question 2 but i couldnt fix bugs in my code because i was so nervous :(

Comments (6)