-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodechef
More file actions
38 lines (34 loc) · 921 Bytes
/
codechef
File metadata and controls
38 lines (34 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Tax in Chefland
t=int(input())
for i in range(t):
X=int(input())
if X<=100:
print(X)
else:
print(X-10)
https://www.codechef.com/problems/TAXSAVING
t=int(input())
for i in range(t):
X,Y=map(int,input().split())
print(X-Y)
https://www.codechef.com/learn/BP00BP22/problems/ST04
t = int(input())
for i in range(t):
A = input()
B = input()
i = 0
n = len(A)
#Flag is a very imporant tool in programming problems - you will come across various examples in later problems as well
flag = 0
while i<n:
#Checking A from left to right and B from right to left
if A[i]==B[n-i-1]:
i = i + 1
else:
#If specific character in A and B do not match, then they cannot be reverse of each other
flag = 1
break
if flag==1:
print('NO')
else:
print('YES')