Skip to content

Commit a45411e

Browse files
committed
Solution code for hackerrank/arrays-ds
1 parent a33d306 commit a45411e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/python3
2+
3+
import math
4+
import os
5+
import random
6+
import re
7+
import sys
8+
9+
#
10+
# Complete the 'reverseArray' function below.
11+
#
12+
# The function is expected to return an INTEGER_ARRAY.
13+
# The function accepts INTEGER_ARRAY a as parameter.
14+
#
15+
16+
def reverseArray(a):
17+
# Write your code here
18+
return a[::-1]
19+
20+
21+
if __name__ == '__main__':
22+
fptr = open(os.environ['OUTPUT_PATH'], 'w')
23+
24+
arr_count = int(input().strip())
25+
26+
arr = list(map(int, input().rstrip().split()))
27+
28+
res = reverseArray(arr)
29+
30+
fptr.write(' '.join(map(str, res)))
31+
fptr.write('\n')
32+
33+
fptr.close()

0 commit comments

Comments
 (0)