Skip to content

Commit c205ed9

Browse files
authored
Update AnyorAll.py
1 parent ec9627a commit c205ed9

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

BuiltIns/AnyorAll.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@
88
Updated : 29 August 2022
99
Problem : https://www.hackerrank.com/challenges/any-or-all/problem
1010
'''
11-
12-
ar = sorted(input().split())
13-
14-
if ar[0] < 0:
15-
print(False)
16-
else:
17-
chk = False
18-
for i in ar:
19-
if i == i[::-1]:
20-
chk = True
21-
break
22-
print(chk)
11+
n = input()
12+
ar = input().split()
13+
print(all([int(i)>0 for i in ar]) and any([i==i[::-1] for i in ar]))

0 commit comments

Comments
 (0)