buy1get1 wrong answer help

http://www.codechef.com/viewsolution/3312318

please help getting wrong answer

problem link BUY1GET1 Problem - CodeChef

i think there are some unnecessary spaces in the test file. i replaced “gets()” with “cin” and got accepted. accepted solution CodeChef: Practical coding for everyone.
hope this helps :slight_smile:

1 Like