digits must be cut into consecutive pieces so that:
- every piece consists of one repeated digit;
- exactly one piece has length 2, and all the others have length 3.
Return True if such a cut exists, and False otherwise.digits="55566677" → True
Cut it as "555", "666", "77": two triples and one pair.
digits="444888" → False
Only triples come out, but there must be exactly one pair.
digits="1122333" → False
"11" and "22" make two pairs, but only one is allowed.
digits consists of digits onlydigits="55566677"
True
Run checks the first 3 tests in your browser. Submit checks all 17 tests on the server, hidden ones included.