1st phone screen questions :
Given two strings A and B, write a function check if B contains the permutation of A. In other words, one of the first string's permutations is the substring of the second string.
Given two strings A and B, write a function check if B contains the permutation of A. In other words, one of the first string's permutations is the substring of the second string.
input:
a = “apple”
b = “appealing”
output: true (ppeal)
input:
a = “apple”
b = “ppleaasdflkn”
output: false
phone screen 2 :
1) Given n
Build sequence 1, n, 2, n-1, ...
For example n = 5 return 1, 5, 2, 4, 3
n = 6 return
2) Given n
Build all correct bracket sequences of length 2 * n
Example:
n = 2
returns ["(())", "()()"]