Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string solution(string t) {
- if (t[3] == '?') t[3] = '5';
- if (t[4] == '?') t[4] = '9';
- if (t[0] == '?') {
- int x = (t[1] == '?' ? -1 : t[1] - '0');
- t[0] = (x < 4 ? '2' : '1');
- }
- if (t[1] == '?') {
- t[1] = (t[0] == '2' ? '3' : '9');
- }
- return t;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement