We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec9627a commit c205ed9Copy full SHA for c205ed9
1 file changed
BuiltIns/AnyorAll.py
@@ -8,15 +8,6 @@
8
Updated : 29 August 2022
9
Problem : https://www.hackerrank.com/challenges/any-or-all/problem
10
'''
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)
+n = input()
+ar = input().split()
+print(all([int(i)>0 for i in ar]) and any([i==i[::-1] for i in ar]))
0 commit comments