start
stringlengths 5
368
| code
stringlengths 5
143
| end
stringlengths 5
527
|
---|---|---|
b = [2, 1, 8, 5]; r = 10 | r += b[j] | b = [2, 1, 8, 5]; j = False; r = 12 |
f = [[1, 3, 4], [2, 2, 3], [1, 2, 4]]; i = 2; j = 2; s = 4 | s = f[i][j] - f[i][j - 1] | f = [[1, 3, 4], [2, 2, 3], [1, 2, 4]]; i = 2; j = 2; s = 2 |
g = 1; w = 'b'; x = 'abc' | w = x[g:] | g = 1; w = 'bc'; x = 'abc' |
i = 0; t = [(10.0, 1), (20.0, 3), (30.0, 2), (40.0, 4), (50.0, 5)] | r.append(t[i][1]) | i = 0; r = [1]; t = [(10.0, 1), (20.0, 3), (30.0, 2), (40.0, 4), (50.0, 5)] |
t = [2, 3, 4, 5, 6, 7]; v = 8 | t.append(v) | t = [2, 3, 4, 5, 6, 7, 8]; v = 8 |
m = [[1, 2], [0, 3, 4, 2], [0], [1], [1]]; x = 2; y = 3 | m[y - 1].append(x - 1) | m = [[1, 2], [0, 3, 4, 2], [0, 1], [1], [1]]; x = 2; y = 3 |
i = 4; p = 3 | i = p | i = 3; p = 3 |
c = [1, 0]; i = 1 | c[i] = 1 | c = [1, 1]; i = 1 |
c = ['a', 'b', 'c', 'd', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'q', 's', 'u', 'v', 'x', 'y', 'z']; i = 'l' | c.remove(i.lower()) | c = ['a', 'b', 'c', 'd', 'f', 'g', 'h', 'i', 'j', 'k', 'n', 'q', 's', 'u', 'v', 'x', 'y', 'z']; i = 'l' |
i = [['2']]; t = ['2', '2'] | i.append(t) | i = [['2'], ['2', '2']]; t = ['2', '2'] |
j = 1; o = [7, 8] | o.pop(j) | j = 1; o = [7] |
i = 3; k = 0 | k = i | i = 3; k = 3 |
d = OrderedDict([('a', 2), ('b', 3), ('c', 1)]); k = 'c' | d[k] += 1 | d = OrderedDict([('a', 2), ('b', 3), ('c', 2)]); k = 'c' |
a = []; i = 'a' | a.append(i) | a = ['a']; i = 'a' |
b = 'd'; d = {'a': 2, 'b': 2, 'c': 2}; o = 'abcdefghhgfedecba' | d[str(b)] = o.count(b) | b = 'd'; d = {'a': 2, 'b': 2, 'c': 2, 'd': 2}; o = 'abcdefghhgfedecba' |
f = '16'; i = 1; j = 0; m = 6 | m += int(f[j:j + 1]) * 2 ** i | f = '16'; i = 1; j = 0; m = 8 |
b = [0] | b.append(1) | b = [0, 1] |
r = 9 | r += 1 | r = 10 |
e = 2; f = 'd'; o = 0; s = 'abcd' | f = ''.join(sorted(s[o:o + e])) | e = 2; f = 'ab'; o = 0; s = 'abcd' |
a = ['c']; k = 'ck'; t = 'k' | k = t + ''.join(a) | a = ['c']; k = 'kc'; t = 'k' |
i = 3; x = [0, 1, 1, 2, 5, 5] | x[i + 2] = x[i] + x[i + 1] ** 2 | i = 3; x = [0, 1, 1, 2, 5, 27] |
i = 'bab'; j = 1; k = 5; r = 'ababaa ' | i = r[j:len(r) - k] | i = 'ba'; j = 1; k = 5; r = 'ababaa ' |
b = '9F' | e = bin(int(b, 16))[2:] | b = '9F'; e = '10011111' |
i = [48.0, 67.0, 76.0]; j = 0; u = [5329.0, 5184.0, 5776.0] | u[j] += i[j] * i[j] | i = [48.0, 67.0, 76.0]; j = 0; u = [7633.0, 5184.0, 5776.0] |
f = [1, 8, 3, '4']; j = 3 | f[j] = int(f[j]) | f = [1, 8, 3, 4]; j = 3 |
i = 7; j = 0; k = [[1, 1, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]; y = 2 | y = k[i][j - 1] if j >= 1 else 0 | i = 7; j = 0; k = [[1, 1, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]; y = 0 |
q = 1 | q += -1 | q = 0 |
p = {(2): [0, 1]}; x = 4 | p[x] = [] | p = {2: [0, 1], 4: []}; x = 4 |
a = 1; n = 0 | j = n + a | a = 1; j = 1; n = 0 |
s = 'hackerhappy' | s = s[:-1] | s = 'hackerhapp' |
t = -26; u = -1; y = 25.0 | y = t / u | t = -26; u = -1; y = 26.0 |
e = [3, 3]; t = [3, 3, 2]; x = deque([2]) | e.append(t[x[len(x) - 1]]) | e = [3, 3, 2]; t = [3, 3, 2]; x = deque([2]) |
h = 4 | h -= 1 | h = 3 |
j = 58; k = 2 | j += k | j = 60; k = 2 |
i = 2; k = [0, 802743475, '35601423\n', '\n', '\n', '\n'] | k[i] = int(k[i]) | i = 2; k = [0, 802743475, 35601423, '\n', '\n', '\n'] |
a = [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]; i = 1 | a[i + 1] = a[i] ^ i + 1 | a = [0, 1, 3, 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 = 1 |
i = 0; j = 0; m = [[0, inf, inf, inf, inf], [inf, inf, inf, inf, inf], [inf, inf, inf, inf, inf], [inf, inf, inf, inf, inf], [inf, inf, inf, inf, inf]]; s = -2 | m[i + 1][j + 1] = s | i = 0; j = 0; m = [[0, inf, inf, inf, inf], [inf, -2, inf, inf, inf], [inf, inf, inf, inf, inf], [inf, inf, inf, inf, inf], [inf, inf, inf, inf, inf]]; s = -2 |
a = 161; b = [99, 123, 138, 155, 174, 114, 138, 153, 170, 189, 129, 146, 165, 105, 129, 144, 161, 180, 122, 146]; m = 1000 | b.append(a % m) | a = 161; b = [99, 123, 138, 155, 174, 114, 138, 153, 170, 189, 129, 146, 165, 105, 129, 144, 161, 180, 122, 146, 161]; m = 1000 |
g = '2 '; k = 1; m = 0; x = 0 | g += str(m + 1 + 2 * x * k) + ' ' | g = '2 1 '; k = 1; m = 0; x = 0 |
q = 1 | q -= 1 / (2 << count) | q = 1.0 |
k = 1; r = [[1, 2, 3, 4], [5, 11, 10, 8], [9, 7, 6, 12], [13, 14, 15, 16]]; t = [13, 14, 15, 16, 12, 8, 4, 3, 2, 1]; z = 0 | t += [r[k][z]] | k = 1; r = [[1, 2, 3, 4], [5, 11, 10, 8], [9, 7, 6, 12], [13, 14, 15, 16]]; t = [13, 14, 15, 16, 12, 8, 4, 3, 2, 1, 5]; z = 0 |
i = 0; y = 4 | i = y - 1 | i = 3; y = 4 |
a = 'BANANA'; i = 4; u = 10 | u += len(a) - i | a = 'BANANA'; i = 4; u = 12 |
a = 2 | a += 1 | a = 3 |
a = {'i', 'h'}; b = {'o', 'd', 'w', 'r', 'l'} | a = a.intersection(b) | a = set(); b = {'l', 'r', 'd', 'o', 'w'} |
i = 33; p = 'hACKERrANK.COM PRESENTS "pYTHONIS'; s = 'HackerRank.com presents "Pythonist 2".' | p = p + s[i].upper() | i = 33; p = 'hACKERrANK.COM PRESENTS "pYTHONIST'; s = 'HackerRank.com presents "Pythonist 2".' |
e = 30; h = 10; i = 2; x = [10, 20, 30, 100, 200, 300, 1000] | h = h + (x[i] * i - e) | e = 30; h = 40; i = 2; x = [10, 20, 30, 100, 200, 300, 1000] |
r = '101'; w = '12' | w = str(int(r) + 1) | r = '101'; w = '102' |
b = ['{'] | b.pop() | b = [] |
a = [5, 8, 14]; f = [[3, 8], [0, 8]]; i = 8; j = 2 | f.append([abs(a[j] - i), i]) | a = [5, 8, 14]; f = [[3, 8], [0, 8], [6, 8]]; i = 8; j = 2 |
a = 2; j = {(2): 2} | j[a] = j[a] + 1 | a = 2; j = {2: 3} |
h = 1; i = 1; t = 'ifailuhkqq'; v = 2 | h += (v + 1) ** (ord(t[i + v]) - ord('a')) | h = 6562; i = 1; t = 'ifailuhkqq'; v = 2 |
a = [2, 5, 3, 6]; f = [1, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4]; i = 3; j = 6 | f[j] += f[j - a[i]] | a = [2, 5, 3, 6]; f = [1, 0, 1, 1, 1, 2, 3, 2, 3, 3, 4]; i = 3; j = 6 |
h = [[0, 2, 1], [1, 1, 1], [2, 0, 0]]; i = 2; j = 1; q = 1 | q = q + h[j][i] | h = [[0, 2, 1], [1, 1, 1], [2, 0, 0]]; i = 2; j = 1; q = 2 |
y = 3 | m = [[] for friend in range(0, y)] | m = [[], [], []]; y = 3 |
d = 5; i = 3; x = [6, 5, 8, 4, 7, 10, 9] | d = x[i] | d = 4; i = 3; x = [6, 5, 8, 4, 7, 10, 9] |
d = 3; i = 0; t = 1 | n += [[i, t + d]] | d = 3; i = 0; n = [[0, 4]]; t = 1 |
s = ['l', 'u', 'h', 'k'] | s.sort() | s = ['h', 'k', 'l', 'u'] |
a = ['ABCDEFGHIJKLIMNOQRSTUVWXYZ']; g = 4; l = [] | l.append(a[-1][:g]) | a = ['ABCDEFGHIJKLIMNOQRSTUVWXYZ']; g = 4; l = ['ABCD'] |
h = 9699690; o = [2, 6, 30, 210, 2310, 30030, 510510] | o.append(h) | h = 9699690; o = [2, 6, 30, 210, 2310, 30030, 510510, 9699690] |
j = 2; l = [3, 4, 2, 5, 6, 7] | l[j], l[j - 1] = l[j - 1], l[j] | j = 2; l = [3, 2, 4, 5, 6, 7] |
i = 4; m = 6; r = [[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) for _ in range(m)] | i = 4; m = 6; r = [[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], []] |
w = {(1): 1}; x = 1 | w[x] += 1 | w = {1: 2}; x = 1 |
k = {'c', 'd', 'b', 'a'}; u = {'e', 'b', 'c', 'd', 'a'} | u = u & k | k = {'a', 'b', 'c', 'd'}; u = {'a', 'b', 'c', 'd'} |
k = [0, 2, 5]; s = 0 | s = max(0, k[END] - 1) | k = [0, 2, 5]; l = False; s = 0 |
c = 'e'; z = {'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 1, 'f': 2, 'g': 2, 'h': 2} | z[c] += 1 | c = 'e'; z = {'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 2, 'f': 2, 'g': 2, 'h': 2} |
f = [[0], [1], [2]]; m = 1; p = [1, 2]; x = [0, 0, 2] | f[x[p[0] - 1]].append(m) | f = [[0, 1], [1], [2]]; m = 1; p = [1, 2]; x = [0, 0, 2] |
a = 2; b = 10; i = 58; v = 2882303761517117542 | v += a ^ b << i | a = 2; b = 10; i = 58; v = 5764607523034234984 |
o = 1000000007; p = [1, 1, 2, 3, 5, 8, 13, 807526948, 778742000, 586268941, 365010934, 951279875, 316290802, 267570670] | p.append((p[-1] + p[-2]) % o) | o = 1000000007; p = [1, 1, 2, 3, 5, 8, 13, 807526948, 778742000, 586268941, 365010934, 951279875, 316290802, 267570670, 583861472] |
c = {(0): 1, (1): 1, (2): 1}; i = 2; r = 16; u = [1, 3, 5, 7, 9]; x = 3 | r += c[i % x] * u[i] | c = {0: 1, 1: 1, 2: 1}; i = 2; r = 21; u = [1, 3, 5, 7, 9]; x = 3 |
e = 2; s = 1; v = -2 | v = e - s | e = 2; s = 1; v = 1 |
i = 2; j = 1; s = 0; u = [[1, 3, 4], [2, 2, 3], [1, 2, 4]] | s = u[j][i] - u[j - 1][i] | i = 2; j = 1; s = -1; u = [[1, 3, 4], [2, 2, 3], [1, 2, 4]] |
e = True; j = 0; x = 10 | e = True if j ^ x > x else False | e = False; j = 0; x = 10 |
x = 5 | a = x % 8 | a = 5; x = 5 |
a = 'popleft'; d = deque(['4', '1', '2']); z = [] | getattr(d, a)(*z) | a = 'popleft'; d = deque(['1', '2']); z = [] |
b = ['3']; h = '10 2 5\n' | b = h.split() | b = ['10', '2', '5']; h = '10 2 5\n' |
m = 2 | z = m - p2 | m = 2; t = -16; z = 18 |
k = [(2, 3), (4, -1), (5, -1), (6, -1), (7, 8), (-1, 9), (-1, -1), (10, 11), (-1, -1), (-1, -1), (-1, -1)]; l = 4; r = -1; v = 2 | k[v - 1] = r, l | k = [(2, 3), (-1, 4), (5, -1), (6, -1), (7, 8), (-1, 9), (-1, -1), (10, 11), (-1, -1), (-1, -1), (-1, -1)]; l = 4; r = -1; v = 2 |
n = 4 | n -= 1 | n = 3 |
i = 0; l = [['11', '2', '4'], ['4', '5', '6'], ['10', '8', '-12']]; w = 3 | z = z + int(l[i][w - 1 - i]) | i = 0; l = [['11', '2', '4'], ['4', '5', '6'], ['10', '8', '-12']]; w = 3; z = -43 |
a = 0; b = 1; n = 5; s = '4 3 7' | n, a, b = list(map(int, s.split())) | a = 3; b = 7; n = 4; s = '4 3 7' |
j = 2; p = [6, 5]; w = [6, 5, 4] | p.append(w[j]) | j = 2; p = [6, 5, 4]; w = [6, 5, 4] |
r = [2, 3, 5, 7, 11]; x = 13 | r.append(x) | r = [2, 3, 5, 7, 11, 13]; x = 13 |
g = {(2, 2, 1), (3, 2, 1)}; t = 4, 2, 1 | g.add(t) | g = {(2, 2, 1), (4, 2, 1), (3, 2, 1)}; t = (4, 2, 1) |
b = '1'; x = [1, 1, 2, 1] | x.append(int(b)) | b = '1'; x = [1, 1, 2, 1, 1] |
k = [1, 2]; r = 3 | k.append(r) | k = [1, 2, 3]; r = 3 |
e = [0, 1, 0, 0]; v = 2 | e[v] = 1 | e = [0, 1, 1, 0]; v = 2 |
a = [0, 0, 0, 0, 0, 0] | a.append(0) | a = [0, 0, 0, 0, 0, 0, 0] |
a = [1, 6, 9]; j = 2; s = 9 | s += a[j] | a = [1, 6, 9]; j = 2; s = 18 |
i = '092282' | g = list(i) | g = ['0', '9', '2', '2', '8', '2']; i = '092282' |
b = '40'; q = ['0', '1', '0', '1', '1', '0', '0', '0'] | q = bin(int(b, 16))[2:] | b = '40'; q = '1000000' |
c = 1000000007; i = 16; v = [1, 1, 2, 6, 24, 120, 720, 362880, 3628800, 39916800, 479001600, 227020758, 178290591, 674358851] | v.append(v[-1] * i % c) | c = 1000000007; i = 16; v = [1, 1, 2, 6, 24, 120, 720, 362880, 3628800, 39916800, 479001600, 227020758, 178290591, 674358851, 789741546] |
r = 11; x = 15 | r = x - 1 | r = 14; x = 15 |
i = 18; m = [1, 1, 3, 3, 6, 8, 9, 9, 10, 12, 13, 16, 16] | m.append(i) | i = 18; m = [1, 1, 3, 3, 6, 8, 9, 9, 10, 12, 13, 16, 16, 18] |
d = ['{', '{', '[', '[']; i = '[' | i = d.pop() | d = ['{', '{', '[']; i = '[' |
a = 'bcd'; i = 2; j = 3; s = 'abcd' | a = ''.join(sorted(s[i:j])) | a = 'c'; i = 2; j = 3; s = 'abcd' |
g = [20, 7, 8, 2, 5]; i = 1; s = 20 | s = int(g[i]) | g = [20, 7, 8, 2, 5]; i = 1; s = 7 |
a = [[0, 4], [1, 5]]; d = 3; i = 2; t = 3 | a += [[i, t + d]] | a = [[0, 4], [1, 5], [2, 6]]; d = 3; i = 2; t = 3 |
v = [0, 0, 0]; x = 0 | v[x] += 1 | v = [1, 0, 0]; x = 0 |
i = 1; l = 4; m = 'afii'; s = 'ifailuhkqq' | m = list(s[i:i + l]) | i = 1; l = 4; m = ['f', 'a', 'i', 'l']; s = 'ifailuhkqq' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.