The problem : BUY1GET1 Problem - CodeChef
The (wrong) solution: CodeChef: Practical coding for everyone
I am simply counting the occurence of each alphabet in the given string and then calculating the price having accounted for duplicates.
It is able to give the correct output for the 1 sample input and when I try changing values it seem to give the correct output as well so I’m not sure what the problem is. I don’t seem to be formatting the ouptut incorrectly either.