1class Solution {2public:3int countPoints(string rings) {4int n = rings.length();5// It is given that number of rod is 10 0 to 9 so we have to place ring any6// of these7vector<int> vp(10, 0); // store the no of rings8for (int i = 0; i < n; i += 2) {9char col = rings[i];10vp[rings[i + 1] - '0'] |= (col == 'R' ? 1 : col == 'G' ? 2 : 4); // checking for rings11}12int count = 0;13for (int i = 0; i < 10; i++) {14if (vp[i] == 7) {15count++;16}17}18return count;19}20};