start
stringlengths 5
368
| code
stringlengths 5
143
| end
stringlengths 5
527
|
---|---|---|
a = 36; j = [0, 7, 6, 5, 4, 27, 26, 25, 24, 31, 30, 29, 28, 40, 47, 46, 45, 44, 35, 34, 33, 32, 39, 38, 37] | j += [a] | a = 36; j = [0, 7, 6, 5, 4, 27, 26, 25, 24, 31, 30, 29, 28, 40, 47, 46, 45, 44, 35, 34, 33, 32, 39, 38, 37, 36] |
a = '8' | a = int(a) | a = 8 |
i = 1; t = [[3, 2, 1], [1, 2, 3], [3, 2, 1]]; x = 2 | x = t[i].index(min(t[i])) | i = 1; t = [[3, 2, 1], [1, 2, 3], [3, 2, 1]]; x = 0 |
b = [[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 2], [0, 2, 1], [0, 2, 2], [1, 0, 0], [1, 0, 2], [1, 1, 1]]; i = 1; j = 1; k = 2 | b.append([i, j, k]) | b = [[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 2], [0, 2, 1], [0, 2, 2], [1, 0, 0], [1, 0, 2], [1, 1, 1], [1, 1, 2]]; i = 1; j = 1; k = 2 |
d = [1, -1, 1, 1, -1]; f = 2; j = 0; y = [[0, 3, 4, 1000000000, 1000000000], [3, 0, 5, 6, 2], [4, 5, 0, 1000000000, 7], [1000000000, 6, 1000000000, 0, 1000000000], [1000000000, 2, 7, 1000000000, 0]] | f = f + y[j][d[j]] | d = [1, -1, 1, 1, -1]; f = 5; j = 0; y = [[0, 3, 4, 1000000000, 1000000000], [3, 0, 5, 6, 2], [4, 5, 0, 1000000000, 7], [1000000000, 6, 1000000000, 0, 1000000000], [1000000000, 2, 7, 1000000000, 0]] |
n = '6'; p = {'1': 3, '2': 6, '4': 0, '6': 0, '5': 0, '3': 0}; x = 12 | p[n] = p[n] + x | n = '6'; p = {'1': 3, '2': 6, '4': 0, '6': 12, '5': 0, '3': 0}; x = 12 |
a = 7.62939453125e-05; b = 0.000152587890625 | b = a % 2 | a = 7.62939453125e-05; b = 7.62939453125e-05 |
a = 2.5 | n += a | a = 2.5; n = 89.5 |
b = 4; c = [1, 2, 3, 4, 10, 20, 30, 40, 100, 200]; i = 5; r = 30 | r = c[i + b - 1] - c[i] | b = 4; c = [1, 2, 3, 4, 10, 20, 30, 40, 100, 200]; i = 5; r = 80 |
o = 2; x = [2, 0, 0, 0] | o = sum(x[1:]) | o = 0; x = [2, 0, 0, 0] |
i = 35; l = [1, 1, 2, 6, 24, 120, 720, 35757887, 36978716, 109361473, 390205642, 486580460, 57155068, 943272305]; t = 1000000007 | l.append(l[-1] * i % t) | i = 35; l = [1, 1, 2, 6, 24, 120, 720, 35757887, 36978716, 109361473, 390205642, 486580460, 57155068, 943272305, 14530444]; t = 1000000007 |
x = 6 | x /= 2 | x = 3.0 |
g = [[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 0], [1, 0, 0, 0]]; i = 0; j = 0 | g[i][j] = 0 | g = [[0, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 0], [1, 0, 0, 0]]; i = 0; j = 0 |
i = 64; j = 11; s = 63 | s = j ^ i | i = 64; j = 11; s = 75 |
e = '40'; o = [55, 45] | o.append(int(e)) | e = '40'; o = [55, 45, 40] |
i = 0; j = 2; o = ['d', 'k', 'h', 'c'] | o[i] = o[j] | i = 0; j = 2; o = ['h', 'k', 'h', 'c'] |
i = 4; r = 1; w = [1, 1, 2, 1, 3] | r += w[i] | i = 4; r = 4; w = [1, 1, 2, 1, 3] |
p = [[], [], [], [], []]; x = 1; y = 2 | p[x - 1].append(y - 1) | p = [[1], [], [], [], []]; x = 1; y = 2 |
g = [-20, -3916237, -357920, -3620601, 7374819, -7330761, 30, 6246457, - 6461594, 266854, -520, -470] | g.sort() | g = [-7330761, -6461594, -3916237, -3620601, -357920, -520, -470, -20, 30, 266854, 6246457, 7374819] |
a = 'cde'; e = 'c' | a = a.replace(e, '', 1) | a = 'de'; e = 'c' |
i = 1; m = [0, 0, 1001, 1000, 999, 0]; x = 3 | m[i] = x | i = 1; m = [0, 3, 1001, 1000, 999, 0]; x = 3 |
i = '5 -1'; w = 4 | w = int(i.split(' ')[0]) | i = '5 -1'; w = 5 |
i = 11; s = 'aaabbbbcccddd'; x = 4 | x += ord(s[i]) - ord('a') + 1 | i = 11; s = 'aaabbbbcccddd'; x = 8 |
w = {(1): 'one'} | w[2] = 'two' | w = {1: 'one', 2: 'two'} |
m = 12; u = 'because' | m = m - len(u) | m = 5; u = 'because' |
s = 4807526976; t = 7778742049 | s = t | s = 7778742049; t = 7778742049 |
b = 'eegeeksfors'; h = 13; o = 1; t = 'eegeeksfors' | b = t[o:h] | b = 'egeeksfors'; h = 13; o = 1; t = 'eegeeksfors' |
i = 28; o = 1000000007; v = [1, 1, 2, 6, 24, 120, 720, 72847302, 602640637, 860734560, 657629300, 440732388, 459042011, 394134213] | v.append(v[-1] * i % o) | i = 28; o = 1000000007; v = [1, 1, 2, 6, 24, 120, 720, 72847302, 602640637, 860734560, 657629300, 440732388, 459042011, 394134213, 35757887] |
i = 'f'; n = ['c', 'd', 'c', 'd', 'c', 'd', 'c', 'd', 'e', 'e', 'e', 'e'] | n.append(i) | i = 'f'; n = ['c', 'd', 'c', 'd', 'c', 'd', 'c', 'd', 'e', 'e', 'e', 'e', 'f'] |
i = 'm' | o = ord(i) | i = 'm'; o = 109 |
a = [[2, 2, 0, 0], [0, 1, 1, 0], [0, 0, 1, 0], [1, 0, 0, 0]]; x = 1; y = 1 | a[x][y] = 2 | a = [[2, 2, 0, 0], [0, 2, 1, 0], [0, 0, 1, 0], [1, 0, 0, 0]]; x = 1; y = 1 |
a = 4 | a //= 10 | a = 0 |
d = 'hACKERrANK.COM'; x = ' ' | d = d + x.upper() | d = 'hACKERrANK.COM '; x = ' ' |
d = [3, 5, 7, 9]; p = 1 | p = d[0] | d = [3, 5, 7, 9]; p = 3 |
c = 2; k = ['b', 'c', 'd'] | c = len(k) | c = 3; k = ['b', 'c', 'd'] |
b = 1.862645149230957e-09; q = 2 | b /= q | b = 9.313225746154785e-10; q = 2 |
a = 1; j = 36; n = 2; t = -33 | t = a * n - j | a = 1; j = 36; n = 2; t = -34 |
i = 3; j = 90 | j = int(bin(i)[2:].replace('1', '9')) | i = 3; j = 99 |
m = [-4, 7, -1]; p = -4; s = 1 | p += m[s] | m = [-4, 7, -1]; p = 3; s = 1 |
i = 1; j = 1; k = 1; m = [[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0]] | m.append([i, j, k]) | i = 1; j = 1; k = 1; m = [[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0], [1, 1, 1]] |
f = 0; h = ['2', '9', '2', '2', '9', '2'] | h[f] = 9 | f = 0; h = [9, '9', '2', '2', '9', '2'] |
i = 'b'; j = 1 | j += len(i) + 1 | i = 'b'; j = 3 |
f = [0, 1, 2]; i = 2; k = {(0): 9, (1): 7, (2): 0}; w = 8 | k[f.index(i)] = k[f.index(i)] + w - 1 - f.index(i) | f = [0, 1, 2]; i = 2; k = {0: 9, 1: 7, 2: 5}; w = 8 |
s = 4 | i = s | i = 4; s = 4 |
o = 103; x = 107 | o = x | o = 107; x = 107 |
i = 0; q = 1; y = [1, 1, 2, 2, 2, 3] | y[i] = y[i] - q | i = 0; q = 1; y = [0, 1, 2, 2, 2, 3] |
o = 107; t = 97 | t = o | o = 107; t = 107 |
y = ['5', '5'] | k = int(y[0]) | k = 5; y = ['5', '5'] |
h = [1, 3, 2, 6, 1, 2]; i = 4; j = 5; v = 8 | v = h[i] + h[j] | h = [1, 3, 2, 6, 1, 2]; i = 4; j = 5; v = 3 |
d = 1; k = 1; t = 2; u = [[], [], [], [], []] | u[k - 1].append((t - 1, d)) | d = 1; k = 1; t = 2; u = [[(1, 1)], [], [], [], []] |
n = 0; q = 1 | q = n | n = 0; q = 0 |
g = 1; s = 1 | g += s | g = 2; s = 1 |
h = [1, 7, 21, 35, 35, 21, 7, 1]; i = 1; x = [1, 7, 21, 35, 35, 21, 7, 1] | h += [(x[i - 1] + x[i]) % 10 ** 9] | h = [1, 7, 21, 35, 35, 21, 7, 1, 8]; i = 1; x = [1, 7, 21, 35, 35, 21, 7, 1] |
s = 1; v = [[1000000, False], [1000000, False], [1000000, False], [1000000, False], [1000000, False]] | v[s][0] = 0 | s = 1; v = [[1000000, False], [0, False], [1000000, False], [1000000, False], [1000000, False]] |
i = 2; k = 6; w = [1, 1, 4, 1, 1] | k -= w[i] | i = 2; k = 2; w = [1, 1, 4, 1, 1] |
m = ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '0', '1', '1', '1', '1'] | m.append('1') | m = ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1', '0', '1', '1', '1', '1', '1'] |
k = [[1, 2], [1, 2]]; y = '1 2' | k.append([int(x) for x in y.split(' ')]) | k = [[1, 2], [1, 2], [1, 2]]; y = '1 2' |
i = 3 | i = i + 1 | i = 4 |
l = ['ive', 'got', 'a', 'lovely', 'bunch', 'of', 'coconuts']; t = [['ive', 'got', 'some', 'coconuts']] | l = t[0] if t else None | l = ['ive', 'got', 'some', 'coconuts']; t = [['ive', 'got', 'some', 'coconuts']] |
c = 'bb'; s = 'abba'; t = 2; v = 2 | c = ''.join(sorted(s[v:v + t])) | c = 'ab'; s = 'abba'; t = 2; v = 2 |
l = [[2, 3], [4, -1], [5, -1], [6, -1], [7, 8], [-1, 9], [-1, -1], [10, 11], [-1, -1], [-1, -1], [-1, -1]]; n = 2 | i = l[n - 1][0] | i = 4; l = [[2, 3], [4, -1], [5, -1], [6, -1], [7, 8], [-1, 9], [-1, -1], [10, 11], [-1, -1], [-1, -1], [-1, -1]]; n = 2 |
i = 'c'; m = {'a': 1, 'b': 1} | m[i] = 1 | i = 'c'; m = {'a': 1, 'b': 1, 'c': 1} |
l = 73 | y = l // 5 | l = 73; y = 14 |
u = [(1, 2)]; x = 0; y = 2 | u.append((x, y)) | u = [(1, 2), (0, 2)]; x = 0; y = 2 |
d = 4; i = 0; n = 5 | j = (i - d + n) % n | d = 4; i = 0; j = 1; n = 5 |
v = 2; y = [2, 4] | y.append(y[-1] + v) | v = 2; y = [2, 4, 6] |
b = ['x', 'y', 'y', 'u', 'v']; k = 0 | b[k + 1] = b[k] | b = ['x', 'x', 'y', 'u', 'v']; k = 0 |
c = 16; s = 4 | c = c + s | c = 20; s = 4 |
w = -1 | w -= 1 | w = -2 |
l = 5 | r.append(l) | l = 5; r = [5] |
i = 0; l = ['0\n', '802743475\n', '35601423\n', '\n', '\n', '\n'] | l[i] = int(l[i]) | i = 0; l = [0, '802743475\n', '35601423\n', '\n', '\n', '\n'] |
a = ['d', 'k', 'h', 'c']; j = 3; r = 'k' | r = a[j] | a = ['d', 'k', 'h', 'c']; j = 3; r = 'c' |
w = ['UL'] | w.append('UL') | w = ['UL', 'UL'] |
i = 1; p = [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; u = [2, 3, 4, 2, 3, 6, 8, 4, 5] | p[u[i]] += 1 | i = 1; p = [0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; u = [2, 3, 4, 2, 3, 6, 8, 4, 5] |
a = 5; b = 4; n = 3; s = '5 0 1' | n, a, b = list(map(int, s.split())) | a = 0; b = 1; n = 5; s = '5 0 1' |
d = [34543987529435983745230948023948, 3498573497543987543985743989120393097595572309482304]; f = 93475349759384754395743975349573495 | f = d[1] | d = [34543987529435983745230948023948, 3498573497543987543985743989120393097595572309482304]; f = 3498573497543987543985743989120393097595572309482304 |
t = ['a', 'a'] | n = len(t) | n = 2; t = ['a', 'a'] |
a = [1, 2, 3, 4, 5]; r = 5; u = 4 | r = a[u] | a = [1, 2, 3, 4, 5]; r = 5; u = 4 |
a = [4, 5, 3, 7, 2] | p = a[0] | a = [4, 5, 3, 7, 2]; p = 4 |
b = 'ifailuhkqq'; i = 2; j = 1; s = ['f', 'i'] | s = list(b[j:j + i]) | b = 'ifailuhkqq'; i = 2; j = 1; s = ['f', 'a'] |
n = 1.200000000000001e-62 | n = n / 10 | n = 1.200000000000001e-63 |
k = 3; q = 2 | k = k + q | k = 5; q = 2 |
c = [2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; g = {}; i = 0 | g[c[i]] = 1 | c = [2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; g = {2: 1}; i = 0 |
c = 120; i = 2; l = 4 | c = l - 1 - i | c = 1; i = 2; l = 4 |
a = [10, 3]; i = 10; z = 9 | z += i % a[1] | a = [10, 3]; i = 10; z = 10 |
b = 0; d = [(1, 1), (1, 2), (2, 2)]; i = 1; k = 2 | k = k + d[i][b] | b = 0; d = [(1, 1), (1, 2), (2, 2)]; i = 1; k = 3 |
v = [1]; x = 50000 | v.append(x % 2) | v = [1, 0]; x = 50000 |
c = ['f']; g = 1; i = 2; s = 'ifailuhkqq' | c = sorted(s[i:i + g]) | c = ['a']; g = 1; i = 2; s = 'ifailuhkqq' |
t = 30; x = 27 | t = x | t = 27; x = 27 |
e = 3; n = 1; w = 2 | e = n + e % w | e = 2; n = 1; w = 2 |
d = [7, 4, 7, 4]; i = [3, 3, 3, 4]; y = 3 | i[y] = d[y] ^ d[0] | d = [7, 4, 7, 4]; i = [3, 3, 3, 3]; y = 3 |
a = 35; i = [1, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156] | i += [a ** 2] | a = 35; i = [1, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 1225] |
k = '7' | k = int(k) | k = 7 |
h = False; j = 7; k = '1110011011'; p = 1 | h = (p % 2 == 1) ^ bool(int(k[j])) | h = True; j = 7; k = '1110011011'; p = 1 |
i = [(167, 84), (421, 84), (283, 192), (433, 298), (164, 275), (320, 133)]; k = -12405 | k += (i[0][0] - i[-1][0]) * (i[0][1] + i[-1][1]) | i = [(167, 84), (421, 84), (283, 192), (433, 298), (164, 275), (320, 133)]; k = -45606 |
a = [0, 1, 3, 0, 4, 1, 7, 0, 8, 1, 11, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; i = 12; v = [0, 1, 2, 2, 6, 7, 0, 0, 8, 9, 2, 2, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | v[i + 1] = v[i] ^ a[i + 1] | a = [0, 1, 3, 0, 4, 1, 7, 0, 8, 1, 11, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; i = 12; v = [0, 1, 2, 2, 6, 7, 0, 0, 8, 9, 2, 2, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
g = 101; i = 9 | g = i + 1 | g = 10; i = 9 |
a = 'CABA[' | a = a[1:] | a = 'ABA[' |
q = '12'; y = '16' | y = q | q = '12'; y = '12' |
i = 5; j = 1; q = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 2, 2, 2], [0, 1, 1, 2, 2, 3], [0, 1, 2, 2, 2, 3], [0, 0, 0, 0, 0, 0]] | q[i][j] = max(q[i - 1][j], q[i][j - 1]) | i = 5; j = 1; q = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 1, 1], [0, 0, 0, 2, 2, 2], [0, 1, 1, 2, 2, 3], [0, 1, 2, 2, 2, 3], [0, 1, 0, 0, 0, 0]] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.