Skip to content

Commit d2ad0f1

Browse files
committed
Built-Ins 3-6
1 parent 648b50d commit d2ad0f1

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

Built-Ins/Any or All.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Any or All
2+
# https://www.hackerrank.com/challenges/any-or-all/problem
3+
4+
n = int(input().strip())
5+
a = list(map(int, input().split()))[:n]
6+
print(True if all(i > 0 for i in a) and any(str(i) == str(i)[::-1] for i in a) else False)

Built-Ins/Athlete Sort.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Athlete Sort
2+
# https://www.hackerrank.com/challenges/python-sort-sort/problem
3+
4+
n, m = map(int, input().split())
5+
details = []
6+
for _ in range(n):
7+
details.append(list(map(int, input().split()))[:m])
8+
k = int(input().strip())
9+
for i in sorted(details, key = lambda x: x[k]): print(*i, sep = ' ')

Built-Ins/Python Evaluation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Python Evaluation
2+
# https://www.hackerrank.com/challenges/python-eval/problem
3+
4+
eval(input().strip())

Built-Ins/ginortS.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# ginortS
2+
# https://www.hackerrank.com/challenges/ginorts/problem
3+
4+
import string
5+
6+
print(*sorted(input().strip(), key = (string.ascii_letters + '1357902468').index), sep = '')

0 commit comments

Comments
 (0)