We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05c7204 commit ed1861dCopy full SHA for ed1861d
hackerrank/performance_command.py
@@ -0,0 +1,22 @@
1
+
2
+N = int(input())
3
+i = 1
4
+data = []
5
+while i <= 12:
6
+ a = input()
7
+ d = a.split()
8
+ if d[0] == "insert":
9
+ data.insert(int(d[1]), int(d[2]))
10
+ elif d[0] == "remove":
11
+ data.remove(int(d[1]))
12
+ elif d[0] == "append":
13
+ data.append(int(d[1]))
14
+ elif d[0] == "sort":
15
+ data.sort()
16
+ elif d[0] == "pop":
17
+ data.pop()
18
+ elif d[0] == "reverse":
19
+ data.reverse()
20
+ elif d[0] == "print":
21
+ print(data)
22
+ i += 1
hackerrank/permutation_shuffling.py
@@ -0,0 +1,7 @@
+from itertools import permutations
+s = input().split()
+S, k = s[0], int(s[1])
+for p in sorted(permutations(S, k)):
+ print("".join(p))
0 commit comments