why my solution is giving me wrong answer ? following editorial approach. link CodeChef: Practical coding for everyone