Facebook| Phone Interview | Sorted array from [0,99], output missing numbers as string
Anonymous User
916

Q1. Given a sorted array from [0, 99], output missing numbers as a string, separated by comma. If
there are MORE than 2 consecutive missing numbers, output the first and the last separated by
hyphen.
Example: Input: [2, 4, 7, 13, 20]

Output: "0,1,3,5,6,8-12,14-19,21-99"

Q2. Given a binary tree of integers, write a function to compute the sums of all the root-to-leaf path.
Input : 2 - 3 - 1, 2 - 3 - 5, 2 - 5

Output: [6, 10, 7]

Position : E4/E5
Location: USA

Comments (6)