There is a char array consists of 'R', 'G' and 'B' only. You need to write code to sort it in a way that all 'R' should come at start and all 'B' come at the end.

It should look like:
RRRRRRGGGGGBBBBBB