Q1:- Input:
L = [a, b, c, d, e]
N = 3 // non-negative
Output:
[
[a, b, c],
[b, c, d],
[c, d, e],
]
Q2:- Input:
L = [a, b, c, d, e, f, g]
N = 3
K = 2 // non-negative skip-budget
Output:
[
[['a', 'b', 'c'], ['a', 'b', 'd'], ['a', 'b', 'e'], ['a', 'c', 'd'], ['a', 'c', 'e'], ['a', 'd', 'e'], ['b', 'c', 'd'], ['b', 'c', 'e'], ['b', 'c', 'f'], ['b', 'd', 'e'], ['b', 'd', 'f'], ['b', 'e', 'f'], ['c', 'd', 'e'], ['c', 'd', 'f'], ['c', 'd', 'g'], ['c', 'e', 'f'], ['c', 'e', 'g'], ['c', 'f', 'g'], ['d', 'e', 'f'], ['d', 'e', 'g'], ['d', 'f', 'g'], ['e', 'f', 'g']]
]
Did solve the second using recusion and he asked for a more optimal approach only verbally(I said something similar to DP)
Also I said time and space complexity as exponential (correct me if I am wrong)
Q3:- https://leetcode.com/problems/valid-number/
Q4:-
https://leetcode.com/problems/top-k-frequent-elements/description/ (asked for a optimal solution, I did write both priority queue and bucket sort for this)
Waiting on behavioral round, can some one please post most repeated behavioral questions?
Also point out the similar questions if you know on leedcode