Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,052 views

All past online assesments of Google can be found using the tag "google_oa" in the search bar.

Here is the link :  https://www.desiqna.in/tag/google_oa

in Online Assessments by Expert (34,270 points) | 1,052 views

1 Answer

0 like 0 dislike

Google Online Assessment  (OA) - Rings on Rods

You have 10 rods numbered from 0 to 9. There are three types of rings, red, green and blue, being put on the rods. You get a point for each rod that has a ring of each color on it, i.e. to get a point you need a red ring, green ring and blue ring on one rod.

A ring put on a rod is represented by two characters, the first describes the color of the ring and the second describes which number rod it is on from 0 to 9. For example "R8" means that a red ring is being put on the 8th rod.

Input

  • s: a corrent string of length 2N describing the N rings put on rods

Output

how many points you will get

Examples

Example 1:

Input:


 
1s = B2R5G2R2

Output1

Explanation:

One point for rings put on the second rod.

by Expert (34,270 points)