start
stringlengths 5
368
| code
stringlengths 5
143
| end
stringlengths 5
527
|
---|---|---|
e = 1; n = [2, 2, 1] | n += [e] | e = 1; n = [2, 2, 1, 1] |
h = 'ifailuhkqq'; i = 1; j = 5; s = ['l'] | s = list(h[j:j + i]) | h = 'ifailuhkqq'; i = 1; j = 5; s = ['u'] |
x = 5 | l = list(range(x)) | l = [0, 1, 2, 3, 4]; x = 5 |
a = 1; w = [-1, 2, -1, -1] | t = w[a] | a = 1; t = 2; w = [-1, 2, -1, -1] |
s = [9]; x = 10 | s.append(x) | s = [9, 10]; x = 10 |
c = [3, 10, 2, 9] | b = sum(c) | b = 24; c = [3, 10, 2, 9] |
c = [0, 1, 2] | j, k = min(c), max(c) | c = [0, 1, 2]; j = 0; k = 2 |
e = 99910002; n = '9991001' | n = str(e) | e = 99910002; n = '99910002' |
a = 6; s = '2 3 4 ' | s += str(a) + ' ' | a = 6; s = '2 3 4 6 ' |
d = {(1): 5, (2): 4, (3): 5, (6): 5, (5): 5, (4): 5, (8): 1}; e = 2 | d[e] += 1 | d = {1: 5, 2: 5, 3: 5, 6: 5, 5: 5, 4: 5, 8: 1}; e = 2 |
s = 2178309; t = 3524578 | s = t | s = 3524578; t = 3524578 |
j = [1, 3, 1] | c.append(sum(j)) | c = [5]; j = [1, 3, 1] |
n = 2; p = '000000' | p = '0' * n | n = 2; p = '00' |
e = 30; j = 100; n = 20 | e = j - n | e = 80; j = 100; n = 20 |
p = 9 | p += 1 | p = 10 |
a = 3; c = 2 | c = a | a = 3; c = 3 |
l = 2; v = 'cgg' | l = len(v) | l = 3; v = 'cgg' |
f = '15'; y = '91011121314' | y = y + f | f = '15'; y = '9101112131415' |
i = 3 | i = i + 1 | i = 4 |
j = 32 | j += 1 | j = 33 |
a = 'hello' | e = len(a) | a = 'hello'; e = 5 |
d = 0; e = 7; k = {'0': [5, 3], '1': [7]}; y = 1 | e = k[str(d)][y % len(k[str(d)])] | d = 0; e = 3; k = {'0': [5, 3], '1': [7]}; y = 1 |
s = {1, 2, 3, 5, 8, 13, 21}; u = 34 | s.add(u) | s = {1, 2, 3, 34, 5, 8, 13, 21}; u = 34 |
c = 5; g = 3; j = 5 | j = g + c | c = 5; g = 3; j = 8 |
i = ['b', 'b', 'x', 'x']; v = 'x' | i.remove(v) | i = ['b', 'b', 'x']; v = 'x' |
t = 5 | t = t + 1 | t = 6 |
a = '111111111111111000011101101111' | a += '1' | a = '1111111111111110000111011011111' |
a = 12; j = 2; k = 4 | a = 4 * 9 + 2 * (9 - j) - (6 - k - 1) | a = 49; j = 2; k = 4 |
h = [4, 2] | h[1] += 1 | h = [4, 3] |
c = 0; w = 'ac' | c = ord(w[0]) - ord('a') | c = 0; w = 'ac' |
a = ['Malika', 52.0, 56.0, 60.0]; d = {'Krishna': [67.0, 68.0, 69.0], 'Arjun': [70.0, 98.0, 63.0]} | d[a[0]] = [] | a = ['Malika', 52.0, 56.0, 60.0]; d = {'Krishna': [67.0, 68.0, 69.0], 'Arjun': [70.0, 98.0, 63.0], 'Malika': []} |
g = [0, 0, 0, 0]; u = 1; v = 2 | g[v] = u | g = [0, 0, 1, 0]; u = 1; v = 2 |
g = ['10', '8', '-12']; h = 2; i = 3; x = 9 | x += int(g[i - 1 - h]) | g = ['10', '8', '-12']; h = 2; i = 3; x = 19 |
i = [10, 100]; p = [2, 3, 4] | p = list(i) | i = [10, 100]; p = [10, 100] |
m = ['discard', '6']; z = 7 | z = int(m[1]) | m = ['discard', '6']; z = 6 |
x = ['3', '3', '3', '4', '7', '5', '18']; y = '\n' | x.append(y.rstrip()) | x = ['3', '3', '3', '4', '7', '5', '18', '']; y = '\n' |
t = 528 | t *= 2 | t = 1056 |
j = [['Q', '1'], ['M', '1', '2'], ['Q', '2']]; z = ['M', '2', '3'] | j.append(z) | j = [['Q', '1'], ['M', '1', '2'], ['Q', '2'], ['M', '2', '3']]; z = ['M', '2', '3'] |
i = 'Y'; x = {'R': 1, 'B': 1, 'Y': 1} | x[i] += 1 | i = 'Y'; x = {'R': 1, 'B': 1, 'Y': 2} |
b = '0'; s = '1000000000000' | s += b | b = '0'; s = '10000000000000' |
c = [0, 1, 2]; h = [1, 2, 3, 4, 5]; i = 5; n = 3; x = 5 | x = h[n] * (i - c[-1] - 1) | c = [0, 1, 2]; h = [1, 2, 3, 4, 5]; i = 5; n = 3; x = 8 |
c = [10, 20, 20, 10, 10, 30, 50, 10, 20] | m = c[0] | c = [10, 20, 20, 10, 10, 30, 50, 10, 20]; m = 10 |
f = 2.666666666666667; n = 5; r = 2.0 | f = n / r + 1 | f = 3.5; n = 5; r = 2.0 |
i = 8; p = 'hACKERrA'; s = 'HackerRank.com presents "Pythonist 2".' | p = p + s[i].upper() | i = 8; p = 'hACKERrAN'; s = 'HackerRank.com presents "Pythonist 2".' |
a = [4, 5, 3, 7, 2] | p = a[0] | a = [4, 5, 3, 7, 2]; p = 4 |
j = 0; k = 0 | e = 4 * j + 1 + k | e = 1; j = 0; k = 0 |
j = 7; n = 9; t = 54 | t = n * j | j = 7; n = 9; t = 63 |
a = ['a', 'b']; j = 3; k = 3; n = 'abba' | a = list(n[j:k + 1]) | a = ['a']; j = 3; k = 3; n = 'abba' |
s = [1, 4, 9, 16, 25, 36]; x = 49 | s.append(x) | s = [1, 4, 9, 16, 25, 36, 49]; x = 49 |
a = ['a']; w = ['b'] | w = sorted(a) | a = ['a']; w = ['a'] |
e = 1; p = [0, 1, 0, 4, 3, 1, 2, 0, 1] | p.append(e) | e = 1; p = [0, 1, 0, 4, 3, 1, 2, 0, 1, 1] |
i = 4; p = 'hACK'; s = 'HackerRank.com presents "Pythonist 2".' | p = p + s[i].upper() | i = 4; p = 'hACKE'; s = 'HackerRank.com presents "Pythonist 2".' |
d = 3.33333333333332; u = 1.2000000000000003e-14 | d = d + u % 10 | d = 3.333333333333332; u = 1.2000000000000003e-14 |
a = 2; b = 10; d = 2814749767106642; i = 48 | d += a ^ b << i | a = 2; b = 10; d = 5629499534213204; i = 48 |
d = 1000000007; z = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181] | z.append((z[-1] + z[-2]) % d) | d = 1000000007; z = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765] |
q = 4 | q -= 1 | q = 3 |
w = [1, 2, 3, 21, 7, 12, 14, 21] | w.sort() | w = [1, 2, 3, 7, 12, 14, 21, 21] |
a = 21; h = 12 | h = a | a = 21; h = 21 |
c = 1; d = 2; l = 0 | d = c + l | c = 1; d = 1; l = 0 |
i = 't'; k = 2; p = 'w' | p = chr((ord(i) + k - 97) % 26 + 97) | i = 't'; k = 2; p = 'v' |
b = 16; t = 18 | t = b | b = 16; t = 16 |
c = 2; n = 10 | l = n / c | c = 2; l = 5.0; n = 10 |
h = 6; i = 0; n = 0 | n += h - i | h = 6; i = 0; n = 6 |
k = ['2', '3']; s = {(1): [2], (2): [4]} | s.setdefault(int(k[0]), []).append(int(k[1])) | k = ['2', '3']; s = {1: [2], 2: [4, 3]} |
f = 500; k = 1600; o = 1400 | o = abs(2 * f - k) | f = 500; k = 1600; o = 600 |
h = [1, 2, 3]; i = 2; w = 3; z = 5 | z += h[w - i - 1] | h = [1, 2, 3]; i = 2; w = 3; z = 6 |
c = {(1): [2, 3, 4], (2): [1], (3): [1, 5], (4): [1], (5): [3], (6): [], (7 ): []}; j = ['3', '6'] | c[int(j[0])].append(int(j[1])) | c = {1: [2, 3, 4], 2: [1], 3: [1, 5, 6], 4: [1], 5: [3], 6: [], 7: []}; j = ['3', '6'] |
b = {(63): 1, (25): 2, (73): 2, (1): 1, (98): 1, (56): 2, (84): 1, (86): 1, (57): 1, (16): 1, (83): 1, (8): 1, (81): 1}; i = 9 | b[i] = b.get(i, 0) + 1 | b = {63: 1, 25: 2, 73: 2, 1: 1, 98: 1, 56: 2, 84: 1, 86: 1, 57: 1, 16: 1, 83: 1, 8: 1, 81: 1, 9: 1}; i = 9 |
h = {(2): 1, (3): 1, (4): 1, (5): 1, (6): 1, (7): 1}; i = 12 | h[i] = h.get(i, 0) + 1 | h = {2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 12: 1}; i = 12 |
c = 1.3877787807814457e-16; p = 6.938893903907228e-17 | c = p % 2 | c = 6.938893903907228e-17; p = 6.938893903907228e-17 |
i = 'buckles'; m = ['i', 'v', 'o', 'r', 'y'] | m = list(i) | i = 'buckles'; m = ['b', 'u', 'c', 'k', 'l', 'e', 's'] |
x = 2; y = {0} | y.add(x * 2) | x = 2; y = {0, 4} |
l = 'a' | m = ord(l) - ord('a') | l = 'a'; m = 0 |
e = [99, 123, 138, 155, 174, 114, 138, 153, 170, 189, 187, 206, 90, 114, 129, 146, 165, 105, 129, 144]; m = 1000; z = 16, 64, 81 | e.append(sum(z) % m) | e = [99, 123, 138, 155, 174, 114, 138, 153, 170, 189, 187, 206, 90, 114, 129, 146, 165, 105, 129, 144, 161]; m = 1000; z = (16, 64, 81) |
i = 0; s = 'abracadabra' | w += s[i] | i = 0; s = 'abracadabra'; w = 'au4Da' |
n = [2, 4]; w = [[1], [3]] | w.append(n) | n = [2, 4]; w = [[1], [3], [2, 4]] |
x = '4 1\n' | o = o + x | o = '6ly1VUNBdK4 1\n'; x = '4 1\n' |
f = -1; s = 2 | s += f | f = -1; s = 1 |
g = 5; w = 8 | g = w | g = 8; w = 8 |
h = 'cd'; p = {'c': 2, 'd': 2, 'cd': 2} | p[h] += 1 | h = 'cd'; p = {'c': 2, 'd': 2, 'cd': 3} |
f = 199; g = 3 | f = g | f = 3; g = 3 |
d = [[2, 2, 3], [1, 1, 4], [0, 0, 5]]; i = 3; j = [[[0, 2, 0]], [[2, 2, 0], [0, 1, 1]], [[2, 2, 1], [1, 1, 2], [0, 0, 3]], [], [], [], []] | j[i] = d | d = [[2, 2, 3], [1, 1, 4], [0, 0, 5]]; i = 3; j = [[[0, 2, 0]], [[2, 2, 0], [0, 1, 1]], [[2, 2, 1], [1, 1, 2], [0, 0, 3]], [[2, 2, 3], [1, 1, 4], [0, 0, 5]], [], [], []] |
a = 5; o = [0, 1, 1, 1, 1, 0] | o[a] = 1 | a = 5; o = [0, 1, 1, 1, 1, 1] |
o = 1.8189894035458565e-11; s = 9.094947017729282e-12 | o = s % 2 | o = 9.094947017729282e-12; s = 9.094947017729282e-12 |
g = [1, 2, 3, 4, 5]; h = 3; p = 1 | h = g[p] | g = [1, 2, 3, 4, 5]; h = 2; p = 1 |
k = '5'; n = '3' | n, k = [int(n), int(k)] | k = 5; n = 3 |
j = ['a', 'b', 'e', 'e', 'd']; k = 1; x = 'c' | j[k + 1] = x | j = ['a', 'b', 'c', 'e', 'd']; k = 1; x = 'c' |
a = 28; p = [0, 7, 6, 5, 4, 27, 26, 25, 24, 31, 30, 29] | p += [a] | a = 28; p = [0, 7, 6, 5, 4, 27, 26, 25, 24, 31, 30, 29, 28] |
j = ['{', '{', '[', '[']; l = '(' | j.append(l) | j = ['{', '{', '[', '[', '(']; l = '(' |
i = 2 | y.append(i) | i = 2; y = [2] |
c = 40; j = 8; k = 0 | c = 4 * j + 1 + k | c = 33; j = 8; k = 0 |
t = 0 | r = 2 ** (t // 2 + 1) - 1 | r = 1; t = 0 |
p = 4 | p = p + 1 | p = 5 |
i = 6; s = [3, 4, 21, 36, 10, 28, '35', '5', '24', '42'] | s[i] = int(s[i]) | i = 6; s = [3, 4, 21, 36, 10, 28, 35, '5', '24', '42'] |
a = 'a'; i = 1; j = 4; w = 'abaab' | a = w[j:j + i] | a = 'b'; i = 1; j = 4; w = 'abaab' |
n = 3.552713678800501e-14; p = 1.7763568394002505e-14 | n = p % 2 | n = 1.7763568394002505e-14; p = 1.7763568394002505e-14 |
a = 144; u = {1, 2, 3, 34, 5, 8, 13, 21, 55, 89} | u.add(a) | a = 144; u = {1, 2, 3, 34, 5, 8, 13, 144, 21, 55, 89} |
m = 4; t = [False, True, False, True, True, True, True, True, True, True, True, True, True, True, True, True] | t[m] = False | m = 4; t = [False, True, False, True, False, True, True, True, True, True, True, True, True, True, True, True] |
u = 4; w = 2 | w += u | u = 4; w = 6 |
b = '0'; s = '1111111111111111111111111111111' | s += b | b = '0'; s = '11111111111111111111111111111110' |
Subsets and Splits