there n ring ring red green blue the ring distribute rod label 0 9you give string ring length 2n describe n ring place rod every character ring form colorposition pair describe ring whereThe character ith pair denote ith ring color r G BThe second character ith pair denote rod ith ring place 0 9for example R3G2B1 describe n 3 ring red ring place rod label 3 green ring place rod label 2 blue ring place rod label 1return number rod color ring Example 1input ring B0B6G0R6R0R6G9Output 1explanation the rod label 0 hold 3 ring color red green blue the rod label 6 hold 3 ring red blue the rod label 9 hold green ringthu number rod color 1example 2input ring B0R0G0R9R0B0G0Output 1explanation the rod label 0 hold 6 ring color red green blue the rod label 9 hold red ringthu number rod color 1example 3input ring g4output 0explanation only ring give Thus rod color constraintsringslength 2 n1 n 100ringsi R G B 0indexedringsi odd digit 0 9 0indexed