chandan's submission of STRINGS AND WEIGHTS | CodeChef