Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. string solution(string t) {
  2.   if (t[3] == '?') t[3] = '5';
  3.   if (t[4] == '?') t[4] = '9';
  4.   if (t[0] == '?') {
  5.     int x = (t[1] == '?' ? -1 : t[1] - '0');
  6.     t[0] = (x < 4 ? '2' : '1');
  7.   }
  8.   if (t[1] == '?') {
  9.     t[1] = (t[0] == '2' ? '3' : '9');
  10.   }
  11.   return t;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement