LinkedIn Interview Question

Explain the process. How did you come up with this solution. Why do you think this is viable solution?