Connected Interview Question

For the first problem, the input is unclear.