- 2 questions
- 90 minutes
- online
- 1. Given non-empty string S of length N consisting of alphanumeric characters and dashes, and integer K, re-arrange the string s.t. it satisfies the following:
- each group of K characters is separated by a dash, except the first group, which is at least one character
- all lower cases become upper case
- e.g. S = "2-410r7-4k", K = 4 becomes "24A0-R74K"
- e.g. S = "2-410r7-4k", K = 3 becomes "24-A0R-74K"
- 2. Given BST B, integers A and B, return the largest subtree s.t. all elements are within range [A..B]
dec 30 2016 ∞
dec 30 2016 +