start
stringlengths 5
368
| code
stringlengths 5
143
| end
stringlengths 5
527
|
---|---|---|
c = [[0, 1, 0, 0, 1, 0], [1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 1, 0], [1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 1, 0], [0, 1, 0, 0, 1, 0]]; i = 1; r = [[0, 1, 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, 0, 0]] | r[i][0] = c[i][0] | c = [[0, 1, 0, 0, 1, 0], [1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 1, 0], [1, 1, 1, 1, 1, 1], [0, 1, 0, 0, 1, 0], [0, 1, 0, 0, 1, 0]]; i = 1; r = [[0, 1, 0, 0, 1, 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]] |
i = 4; x = 9 | x = i * i | i = 4; x = 16 |
k = 4; x = 0; y = [1, 2, 3, 4, 10, 20, 30, 40, 100, 200] | d = y[x + k - 1] - y[x] | d = 3; k = 4; x = 0; y = [1, 2, 3, 4, 10, 20, 30, 40, 100, 200] |
a = {1, 2, 3, 4, 6, 8}; h = 3; j = 3 | a.add(j * h) | a = {1, 2, 3, 4, 6, 8, 9}; h = 3; j = 3 |
i = 2; k = 2 | i += k | i = 4; k = 2 |
n = ['_', 1, 0]; q = [['D', 2, 1]] | q.append(n) | n = ['_', 1, 0]; q = [['D', 2, 1], ['_', 1, 0]] |
l = {1, 2, 3, 4, 5, 6, 7, 8, 9, 66, 11, 55}; s = {35, 7, 22, 58, 62} | l ^= s | l = {1, 2, 3, 4, 5, 6, 8, 9, 66, 11, 35, 22, 55, 58, 62}; s = {35, 7, 22, 58, 62} |
c = [3, 2]; l = [5]; m = 0 | l = c[:m + 1] | c = [3, 2]; l = [3]; m = 0 |
i = -1; l = 2 | i = l - 1 | i = 1; l = 2 |
e = {(63): 1, (25): 1, (73): 2, (1): 1, (98): 1}; i = 56 | e[i] = e.get(i, 0) + 1 | e = {63: 1, 25: 1, 73: 2, 1: 1, 98: 1, 56: 1}; i = 56 |
s = 1; x = 1 | x ^= s | s = 1; x = 0 |
x = 21 | x = x + 1 | x = 22 |
i = 21; p = 'hACKERrANK.COM PRESEN'; s = 'HackerRank.com presents "Pythonist 2".' | p = p + s[i].upper() | i = 21; p = 'hACKERrANK.COM PRESENT'; s = 'HackerRank.com presents "Pythonist 2".' |
e = 10; g = [0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 2, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 2, 1] | g[e] += 1 | e = 10; g = [0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 2, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 2, 1] |
w = [1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1]; x = 1; y = 3 | w.append(abs(int(x) - int(y))) | w = [1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2]; x = 1; y = 3 |
b = '0'; s = '10000000000000' | s += b | b = '0'; s = '100000000000000' |
f = ['3', '1'] | n, k = int(f[0]), int(f[1]) | f = ['3', '1']; k = 1; n = 3 |
p = 'SOSSOT' | r = p | p = 'SOSSOT'; r = 'SOSSOT' |
i = 2; m = 0; x = [[1000000, False], [0, True], [6, False], [6, False], [1000000, False]] | m = x[i][0] | i = 2; m = 6; x = [[1000000, False], [0, True], [6, False], [6, False], [1000000, False]] |
o = 3; s = 2; v = 4 | v = int(s) + o | o = 3; s = 2; v = 5 |
y = 1 | z += y | y = 1; z = 0 |
s = 2; t = 3 | t = s | s = 2; t = 2 |
j = 0; k = 4; r = 4 | r = 4 * 9 + 2 * (9 - j) - (6 - k - 1) | j = 0; k = 4; r = 53 |
a = 3 | b = a + 1 | a = 3; b = 4 |
k = [[1, 1, 1], [1, 1, 1], [1, 2, 2]]; o = [1, 2, 3] | k.append(o) | k = [[1, 1, 1], [1, 1, 1], [1, 2, 2], [1, 2, 3]]; o = [1, 2, 3] |
j = 6; z = 0 | a.append(10 * z + j + 1) | a = [7]; j = 6; z = 0 |
a = 2; b = 10; i = 16; k = 655378 | k += a ^ b << i | a = 2; b = 10; i = 16; k = 1310740 |
c = 24; s = 1 | c = c + s | c = 25; s = 1 |
c = 'd'; d = {'a': 2, 'b': 2, 'c': 2} | d[c] = 1 | c = 'd'; d = {'a': 2, 'b': 2, 'c': 2, 'd': 1} |
i = 6; k = '10 2 5 ' | k += str(i) + ' ' | i = 6; k = '10 2 5 6 ' |
j = [2, 2]; p = 1 | j.append(p) | j = [2, 2, 1]; p = 1 |
i = 3; j = 1; s = 6; x = [[0, inf, inf, inf, inf], [-2, -2, inf, inf, inf], [-6, -2, -6, inf, inf], [-12, -2, -2, -12, inf], [inf, inf, inf, inf, inf]] | x[i + 1][j + 1] = s | i = 3; j = 1; s = 6; x = [[0, inf, inf, inf, inf], [-2, -2, inf, inf, inf], [-6, -2, -6, inf, inf], [-12, -2, -2, -12, inf], [inf, inf, 6, inf, inf]] |
i = 2 | y.append(i) | i = 2; y = [2] |
d = '6'; l = '5' | l, d = int(l), int(d) | d = 6; l = 5 |
a = [1, 2, 3, 4, 1]; j = '3 '; x = 2 | j = str(a[x - 1]) + ' ' + j | a = [1, 2, 3, 4, 1]; j = '2 3 '; x = 2 |
i = 4; l = ['a', 'c', 'b', 'd']; t = ['lmon', 'no answer', 'no answer', 'acbd', 'abcd', 'fedcbabcd'] | l = list(t[i]) | i = 4; l = ['a', 'b', 'c', 'd']; t = ['lmon', 'no answer', 'no answer', 'acbd', 'abcd', 'fedcbabcd'] |
f = 1 | f -= 1 | f = 0 |
i = 16; k = [0, 1, 3, 0, 4, 1, 7, 0, 8, 1, 11, 0, 12, 1, 15, 0, 16, 1, 19, 0, 20]; w = 0 | w = w ^ k[i] | i = 16; k = [0, 1, 3, 0, 4, 1, 7, 0, 8, 1, 11, 0, 12, 1, 15, 0, 16, 1, 19, 0, 20]; w = 16 |
o = 'A' | g.append(o) | g = ['A']; o = 'A' |
k = '('; u = ['{', '{', '[', '[', '('] | k = u.pop() | k = '('; u = ['{', '{', '[', '['] |
c = 'A'; s = ['B'] | s.append(c) | c = 'A'; s = ['B', 'A'] |
i = 7; m = 4 | m = i | i = 7; m = 7 |
i = 2; k = 3; w = 3; x = [1, 2, 3, -1, -2] | w = k + x[i] | i = 2; k = 3; w = 6; x = [1, 2, 3, -1, -2] |
n = 14 | l = n / 2 | l = 7.0; n = 14 |
i = 5; s = 3 | s = s - i | i = 5; s = -2 |
o = 0; v = [[], []]; y = 5 | v[o].append(y) | o = 0; v = [[5], []]; y = 5 |
s = 89; t = 144 | s = t | s = 144; t = 144 |
o = deque([(1, 5), (10, 3)]); x = [3, 4] | o.append((x[0], x[1])) | o = deque([(1, 5), (10, 3), (3, 4)]); x = [3, 4] |
i = 46; x = 2025 | x = i * i | i = 46; x = 2116 |
a = 80; j = 8 | a += j ** 2 | a = 144; j = 8 |
r = ['2', '9']; y = -1 | r.append(str(y)) | r = ['2', '9', '-1']; y = -1 |
d = [1, 2, 3] | k = sum(d[1:]) | d = [1, 2, 3]; k = 5 |
x = [12]; y = 0 | x = x[y + 1:] | x = []; y = 0 |
a = 8; e = [2, 4, 6, 8, 3]; u = 3 | e[e.index(a) + 1] = a if a > u else u | a = 8; e = [2, 4, 6, 8, 8]; u = 3 |
i = 1; j = 1; k = [(0, 1, 0), (0, 4, 0), (1, 0, 0)]; s = 0 | k += [(i, j, s)] | i = 1; j = 1; k = [(0, 1, 0), (0, 4, 0), (1, 0, 0), (1, 1, 0)]; s = 0 |
j = 1; l = 'a'; p = ['b', 'b'] | p[j] = l | j = 1; l = 'a'; p = ['b', 'a'] |
g = [25, 25, 49, 64, 81, 100] | del g[0] | g = [25, 49, 64, 81, 100] |
c = 'e'; m = 'abc'; w = 1 | w = m.count(c) | c = 'e'; m = 'abc'; w = 0 |
j = 1; s = 'baa' | j = len(s) - 1 | j = 2; s = 'baa' |
a = 0; b = 1; d = [[], [], [], [], []] | d[a].append(b) | a = 0; b = 1; d = [[1], [], [], [], []] |
x = 2 | x += 1 | x = 3 |
i = 6; k = [6, 5, 8, 4, 7, 10, 9]; t = 10 | t = k[i] | i = 6; k = [6, 5, 8, 4, 7, 10, 9]; t = 9 |
e = [2, 6, 30, 210, 2310, 30030, 510510, 9699690]; i = 223092870 | e.append(i) | e = [2, 6, 30, 210, 2310, 30030, 510510, 9699690, 223092870]; i = 223092870 |
c = 5; e = 5 | b.add((c, e)) | b = {(5, 5)}; c = 5; e = 5 |
i = 2; j = 7; p = ['i', 'fi', 'afi', 'afii', 'afiil', 'afiilu', 'afhiilu', 'afhiklqqu', 'a', 'ai', 'ail', 'ailu', 'ahilu']; s = 'ifailuhkqq' | p.append(''.join(sorted(s[i:j + 1]))) | i = 2; j = 7; p = ['i', 'fi', 'afi', 'afii', 'afiil', 'afiilu', 'afhiilu', 'afhiklqqu', 'a', 'ai', 'ail', 'ailu', 'ahilu', 'ahiklu']; s = 'ifailuhkqq' |
g = 256; i = 3; n = 'ifailuhkqq'; x = 1 | g -= (x + 1) ** (ord(n[i]) - ord('a')) | g = 0; i = 3; n = 'ifailuhkqq'; x = 1 |
l = 30; r = 38; u = 4.0; v = 35.0 | u = min(abs(l - v), abs(r - v)) | l = 30; r = 38; u = 3.0; v = 35.0 |
f = [['3\n'], ['3', '3\n'], ['4', '7\n'], ['5', '18\n']]; i = ['\n'] | f.append(i) | f = [['3\n'], ['3', '3\n'], ['4', '7\n'], ['5', '18\n'], ['\n']]; i = ['\n'] |
r = ['12', '2', '17'] | v = int(r[2]) | r = ['12', '2', '17']; v = 17 |
a = 1; b = 2 | b, a = a + b, b | a = 2; b = 3 |
i = 3; n = [1, 2, 5, '3'] | n[i] = int(n[i]) | i = 3; n = [1, 2, 5, 3] |
a = [(5, 0), (10, 1), (3, 2)] | a.sort() | a = [(3, 2), (5, 0), (10, 1)] |
m = ['aabbccddeefghi'] | d = m[0] if m else None | d = 'aabbccddeefghi'; m = ['aabbccddeefghi'] |
i = 1; p = 7; s = 6 | s = p + i | i = 1; p = 7; s = 8 |
e = [[4, 5]]; g = [0, 1] | e = [g] | e = [[0, 1]]; g = [0, 1] |
l = {0}; u = 2 | l.add(u) | l = {0, 2}; u = 2 |
n = [2, 5, 4] | z += [n[1:]] | n = [2, 5, 4]; z = [[5, 4]] |
a = ['z', '{']; o = '[' | o = a[len(a) - 1] | a = ['z', '{']; o = '{' |
r = [4, -2, 2]; x = 7 | x = r[2] | r = [4, -2, 2]; x = 2 |
a = [3, 2, 1]; i = 2; j = 2; z = 2 | z = max(a[i:j + 1]) | a = [3, 2, 1]; i = 2; j = 2; z = 1 |
a = 3; x = 6 | a = x % 8 | a = 6; x = 6 |
c = 'dkhc'; j = 2; k = 0; y = ['d', 'k', 'd', 'c'] | y[k] = c[j] | c = 'dkhc'; j = 2; k = 0; y = ['h', 'k', 'd', 'c'] |
g = 4; q = 2 | q = g | g = 4; q = 4 |
p = {(0): [(1, 24), (3, 20), (2, 3)], (1): [(0, 24)], (2): [(0, 3)], (3): [ (0, 20), (2, 12)]}; r = 12; x = 3; y = 2 | p[y].append((x, r)) | p = {0: [(1, 24), (3, 20), (2, 3)], 1: [(0, 24)], 2: [(0, 3), (3, 12)], 3: [(0, 20), (2, 12)]}; r = 12; x = 3; y = 2 |
e = {'0': {}}; i = 0; s = '01234567890' | e[s[i]][counter] = 1 | e = {'0': {-66: 1}}; i = 0; k = -66; s = '01234567890' |
p = 6; r = 2 | p = r | p = 2; r = 2 |
d = {'s1': 8, 's2': 9, 's3': 7}; k = [4, 3, 2] | d['s2'] -= k[0] | d = {'s1': 8, 's2': 5, 's3': 7}; k = [4, 3, 2] |
d = {(1): 3, (2): 3, (3): 3, (6): 3, (5): 3, (4): 3}; e = 2 | d[e] += 1 | d = {1: 3, 2: 4, 3: 3, 6: 3, 5: 3, 4: 3}; e = 2 |
h = [1, 2, 3, 3]; i = 0; u = 6 | u += h[i] | h = [1, 2, 3, 3]; i = 0; u = 7 |
i = 0; q = [1, 2, 3, 4] | z = currentSum + q[i] | i = 0; q = [1, 2, 3, 4]; x = -60; z = -59 |
k = 2; y = 1.734723475976807e-18 | y /= k | k = 2; y = 8.673617379884035e-19 |
b = [5, 4, 3, 4, 5]; i = 0 | g = b[:i] | b = [5, 4, 3, 4, 5]; g = []; i = 0 |
a = [2, 4, 3, 5, 2, 6]; r = 4 | a.append(r) | a = [2, 4, 3, 5, 2, 6, 4]; r = 4 |
i = 24; x = 529 | x = i * i | i = 24; x = 576 |
f = 3; l = 2 | l = f | f = 3; l = 3 |
g = [0, 0, 1, 2, 3]; i = 4; x = 2 | x = g[i] | g = [0, 0, 1, 2, 3]; i = 4; x = 3 |
a = 'b'; b = 'k'; q = ['b', 'l'] | a, b = q | a = 'b'; b = 'l'; q = ['b', 'l'] |
b = 3; c = [1, 2, 3, 4, 10, 20, 30, 40, 100, 200]; i = 3 | b = c[i] | b = 4; c = [1, 2, 3, 4, 10, 20, 30, 40, 100, 200]; i = 3 |
n = 7 | n = n - 1 | n = 6 |
b = {(0): 0}; i = 2 | b[i] = 0 | b = {0: 0, 2: 0}; i = 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.