https://www.codechef.com/viewsolution/21673749

i have applied the concept that if length of garland is 1 then garland is beautiful else i hae counted number of R and G and if they are equal and their sum is even and then i have counted the mismatched pair and printed the result accordingly.

Can anyone please help me to figure out whats wrong…??