Connected interview question

For the first problem, the input is unclear.