Count of ordered triplets (R, G, B) in a given original string
Given a string S of size N, the task is to count all possible triplets in the given string which consists of only 3 colours (R)Red, (G)Green and (B)Blue in the order (R, G, B). Examples: Input: S = "RRGB" Output: 2 Explanation: There are two triplets of RGB in the given string: R at index 0, G at in