Codeforces Round #802 (Div. 2) 1700B. Palindromic Numbers Solution
Problem Link: https://codeforces.com/contest/1700/problem/B
Solution in Python :
- test=int(input())
- while test:
- test-=1
- num=int(input())
- str=int(input())
- str2=int("1"*num)
- if str>str2:
- print(int("1"*(num+1))-str)
- else:
- print(int("9"*num)-str)
No comments