Minimum Cost Network Infrastructure - Coding problem | OneNoughtOne