Dinesh Goyal's submission of Magnet Sort | CodeChef