start
stringlengths 5
368
| code
stringlengths 5
143
| end
stringlengths 5
527
|
---|---|---|
i = 'a' | l[i] = 1 | i = 'a'; l = {'a': 1} |
s = 5; t = {0}; v = [-4, -3, -2, -1, 0, 1, 2] | t.discard(v[s] - 1) | s = 5; t = set(); v = [-4, -3, -2, -1, 0, 1, 2] |
i = 11, 10 | n = i[0] * (i[1] // 10) + i[1] % 10 | i = (11, 10); n = 11 |
c = 'h'; z = {} | s = z.setdefault(c, [0, {}]) | c = 'h'; s = [0, {}]; z = {'h': [0, {}]} |
a = 34534985349875439875439875349875 | a %= 1000000007 | a = 66520193 |
d = 5; n = 15; w = 0.3915926535897931 | w = abs((n - 1) / d - pi) | d = 5; n = 15; w = 0.3415926535897933 |
b = 'b'; s = deque([]) | s.append(b) | b = 'b'; s = deque(['b']) |
d = 10; f = 2; j = 3; q = [[1, 5], [3, 2], [4, 1], [2, 4]]; t = [4, 1, 3, 2] | d += abs(f - q[j][0]) + t[j] | d = 12; f = 2; j = 3; q = [[1, 5], [3, 2], [4, 1], [2, 4]]; t = [4, 1, 3, 2] |
q = [300, 210] | q.sort() | q = [210, 300] |
c = 'e'; f = {'c': 0, 'd': 1}; r = {'c': 1, 'd': 1, 'e': 1}; s = {'a': 1, 'b': 1, 'c': 1} | f[c] = abs(r[c] - s.get(c, 0)) | c = 'e'; f = {'c': 0, 'd': 1, 'e': 1}; r = {'c': 1, 'd': 1, 'e': 1}; s = {'a': 1, 'b': 1, 'c': 1} |
d = 8; p = 6 | p += d // 5 | d = 8; p = 7 |
a = {1, 2}; k = {1, 2, 3}; n = {1, 2, 3} | a = n - k | a = set(); k = {1, 2, 3}; n = {1, 2, 3} |
s = [[3, 4], [3, 5]]; w = [3, 6] | s.append(w) | s = [[3, 4], [3, 5], [3, 6]]; w = [3, 6] |
c = 'd'; h = {'c': 3, 'd': 2} | h[c] += 1 | c = 'd'; h = {'c': 3, 'd': 3} |
i = 5; m = 4 | i += m | i = 9; m = 4 |
a = 2; y = 1000000007 | x = x * a % y | a = 2; x = 999999925; y = 1000000007 |
i = 205; q = {(203): 0, (204): 0} | q[i] = 0 | i = 205; q = {203: 0, 204: 0, 205: 0} |
v = [1, 2, 3, 4, 3, 3, 2, 1] | s = sorted(list(set(v))) | s = [1, 2, 3, 4]; v = [1, 2, 3, 4, 3, 3, 2, 1] |
c = [1, 2], 1; l = [1, 3]; v = 1 | l, v = c | c = ([1, 2], 1); l = [1, 2]; v = 1 |
a = 16; c = 16 | c = c * a | a = 16; c = 256 |
v = 0; x = 8, 1, 0; z = [None, None, 1] | z[v] = x[2] | v = 0; x = (8, 1, 0); z = [0, None, 1] |
i = 1; p = 'bbxx'; y = {'b': 1} | y[p[i]] = y.get(p[i], 0) + 1 | i = 1; p = 'bbxx'; y = {'b': 2} |
m = [5, 3] | n = m[0] | m = [5, 3]; n = 5 |
s = '000000000000000000' | s += '0' | s = '0000000000000000000' |
a = 32951280099; b = 53316291173 | a, b = b, a + b | a = 53316291173; b = 86267571272 |
n = 4 | a = '{0:032b}'.format(n) | a = '00000000000000000000000000000100'; n = 4 |
y = [1, 1, 1, 1, 1, 1, 1, 1, 1] | y.append(1) | y = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] |
k = 3; t = 2 | k = t | k = 2; t = 2 |
i = 7; p = {'h': 2, 'ha': 2, 'hac': 2, 'hack': 2, 'hacke': 1, 'hacker': 1, 'hackerr': 1}; s = 'hackerrank' | p[s[:i + 1]] = 1 | i = 7; p = {'h': 2, 'ha': 2, 'hac': 2, 'hack': 2, 'hacke': 1, 'hacker': 1, 'hackerr': 1, 'hackerra': 1}; s = 'hackerrank' |
m = {(0): [1]}; u = 0; v = 1 | m[v] = [u] | m = {0: [1], 1: [0]}; u = 0; v = 1 |
j = deque([]); v = 0; x = 1 | j.append((x, v)) | j = deque([(1, 0)]); v = 0; x = 1 |
k = ['w', 'e', ' ', 'p', 'r', 'o', 'm', 't', 'l', 'y', 'j', 'u', 'd', 'g', 'a', 'n']; l = 'i' | k.append(l) | k = ['w', 'e', ' ', 'p', 'r', 'o', 'm', 't', 'l', 'y', 'j', 'u', 'd', 'g', 'a', 'n', 'i']; l = 'i' |
n = 5 | s = n * (n - 1) * (n - 2) / 6 | n = 5; s = 10.0 |
c = [4]; x = 8 | c.append(x) | c = [4, 8]; x = 8 |
j = 2; l = [3, 4, 5, 6, 6, 7] | l[j + 1] = l[j] | j = 2; l = [3, 4, 5, 5, 6, 7] |
r = {(0, 1), (-1, 1), (0, 0), (-1, 0), (-1, 2), (1, 1), (-1, -1), (0, -1), (1, 0), (0, 2)}; x = 1; y = 2 | r.add((x, y)) | r = {(0, 1), (1, 2), (-1, 1), (0, 0), (-1, 0), (0, 2), (-1, 2), (-1, -1), (0, -1), (1, 0), (1, 1)}; x = 1; y = 2 |
d = 32.666666666666664; i = 4; s = 3; v = 1 | d += (i / s + 1) * v | d = 35.0; i = 4; s = 3; v = 1 |
q = [4, 0, 0, 0, 1, 0, 4, 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]; x = 0, 'ij' | q[x[0]] += 1 | q = [5, 0, 0, 0, 1, 0, 4, 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]; x = (0, 'ij') |
i = [1, 1, 1, 2, 2]; j = 1; m = 1; w = [1, 0, 0] | w[j] = i[m + 1 + j] | i = [1, 1, 1, 2, 2]; j = 1; m = 1; w = [1, 2, 0] |
a = 0; h = [set()] | h[-1].add(a) | a = 0; h = [{0}] |
b = [[5, 3], [7]]; d = ['2', '1', '1']; o = 0; t = 7 | t = b[o][int(d[2]) % len(b[o])] | b = [[5, 3], [7]]; d = ['2', '1', '1']; o = 0; t = 3 |
a = [1, 2, 3, 4, 5]; i = 3; j = 1; p = 1 | p = a[i] - a[j] | a = [1, 2, 3, 4, 5]; i = 3; j = 1; p = 2 |
c = 'c'; t = ['a', 'b'] | t.append(c) | c = 'c'; t = ['a', 'b', 'c'] |
i = 1; y = 2 | y = i * 2 + 2 | i = 1; y = 4 |
p = 1.7999999999999995e-41 | p /= 10 | p = 1.7999999999999995e-42 |
k = 1; t = 1 | t = k - t | k = 1; t = 0 |
a = [73]; m = 67 | a.append(m) | a = [73, 67]; m = 67 |
s = '-1'; y = '9' | s, y = int(s), int(y) | s = -1; y = 9 |
g = '2 4 '; x = ['1', '2', '', ''] | x = g.split(' ') | g = '2 4 '; x = ['2', '4', '', ''] |
q = 2; v = 3; y = [([], -1), ([2, 3], -1), ([1], -1), ([1], -1)] | y[q][0].append(v) | q = 2; v = 3; y = [([], -1), ([2, 3], -1), ([1, 3], -1), ([1], -1)] |
i = 6; l = [1, 0, 0, 0, 0, 1, 1, 0, 1, 1]; x = 1 | l[i] ^= x | i = 6; l = [1, 0, 0, 0, 0, 1, 0, 0, 1, 1]; x = 1 |
i = 3; s = 2; x = [1, 2, 3, 4, 5] | s = x[i] | i = 3; s = 4; x = [1, 2, 3, 4, 5] |
l = 3; q = {0, 1, 2, 3, 4} | q.remove(l) | l = 3; q = {0, 1, 2, 4} |
f = [2, 3, 4, 1, 5, 6, 7, 8]; i = 3; j = 5 | f = f[:i - 1] + f[j:] | f = [2, 3, 6, 7, 8]; i = 3; j = 5 |
i = 0; y = [3, 3, 1, 1, 1] | g = y[i] | g = 3; i = 0; y = [3, 3, 1, 1, 1] |
e = 3; j = ['1 9', '2 5', '', '', '']; m = 0 | m, e = [int(x) for x in j.pop(0).split()] | e = 9; j = ['2 5', '', '', '']; m = 1 |
i = 19; p = 400831 | p = p ^ 1 << i | i = 19; p = 925119 |
k = 1 | k = k + 1 | k = 2 |
c = ['from', 'the', 'moon.']; l = 3 | l = len(c) | c = ['from', 'the', 'moon.']; l = 3 |
q = [0, 1, 1, 2, 3, 10610209857723, 17167680177565, 27777890035288, 44945570212853, 72723460248141] | q.append(q[-1] + q[-2]) | q = [0, 1, 1, 2, 3, 10610209857723, 17167680177565, 27777890035288, 44945570212853, 72723460248141, 117669030460994] |
a = {(2, 1): 1.1415926535897931, (4, 1): 0.8584073464102069}; d = 2; f = 0.6415926535897931; n = 6 | a[n - 1, d] = f | a = {(2, 1): 1.1415926535897931, (4, 1): 0.8584073464102069, (5, 2): 0.6415926535897931}; d = 2; f = 0.6415926535897931; n = 6 |
c = 3; q = [['2', '1', '0', '0', '0', '0'], ['2', '2', '2', '0', '1', '0']]; r = 1 | q[r][c] = '2' | c = 3; q = [['2', '1', '0', '0', '0', '0'], ['2', '2', '2', '2', '1', '0']]; r = 1 |
c = 1; h = [4, 5, 6]; v = [4] | v.append(h[c]) | c = 1; h = [4, 5, 6]; v = [4, 5] |
i = 0, 2, 3; j = 0; k = [5, 4]; x = 170 | x += k[i[j]] ** 2 | i = (0, 2, 3); j = 0; k = [5, 4]; x = 195 |
b = [4, 16, 36, 64, 100, 144, 196, 256, 324, 400, 1024, 1156, 1296, 1444, 1600, 1764, 1936, 2116, 2304]; i = 50 | b.append(i * i) | b = [4, 16, 36, 64, 100, 144, 196, 256, 324, 400, 1024, 1156, 1296, 1444, 1600, 1764, 1936, 2116, 2304, 2500]; i = 50 |
m = 8 | m += 1 | m = 9 |
e = [0, 'ab']; i = 4 | i = e[0] | e = [0, 'ab']; i = 0 |
i = 4; t = 10 | t = i - 1 | i = 4; t = 3 |
b = 1; e = 'c'; s = 'cdcd'; w = 3 | e = ''.join(sorted(s[w:w + b])) | b = 1; e = 'd'; s = 'cdcd'; w = 3 |
a = [[0, '-'], [6, '-'], [0, '-'], [6, '-'], [4, '-'], [0, 'to'], [1, 'be'], [5, 'question'], [1, 'or']]; t = ['2', 'not'] | a.append([int(t[0]), t[1]]) | a = [[0, '-'], [6, '-'], [0, '-'], [6, '-'], [4, '-'], [0, 'to'], [1, 'be'], [5, 'question'], [1, 'or'], [2, 'not']]; t = ['2', 'not'] |
m = ['N', 'w']; v = [[['Q', 'b'], ['No', 'A'], ['No', 'A'], ['No', 'A']], [['No', 'A'], [ 'No', 'A'], ['No', 'A'], ['No', 'A']], [['No', 'A'], ['N', 'w'], ['No', 'A'], ['No', 'A']], [['No', 'A'], ['Q', 'w'], ['No', 'A'], ['No', 'A']]]; x = 2; y = 1 | m = v[x - 2][y + 1] | m = ['No', 'A']; v = [[['Q', 'b'], ['No', 'A'], ['No', 'A'], ['No', 'A']], [['No', 'A'], ['No', 'A'], ['No', 'A'], ['No', 'A']], [['No', 'A'], ['N', 'w'], ['No', 'A'], ['No', 'A']], [['No', 'A'], ['Q', 'w'], ['No', 'A'], ['No', 'A']]]; x = 2; y = 1 |
a = 3; g = {(7): 0, (1): 1}; i = 2 | g[a] = i | a = 3; g = {7: 0, 1: 1, 3: 2}; i = 2 |
c = '01'; s = '010203' | s = s[len(c):] | c = '01'; s = '0203' |
s = [[1, 1], [1, 1]] | i = sorted(map(sum, s)) | i = [2, 2]; s = [[1, 1], [1, 1]] |
i = 207; x = {(203): 0, (204): 0, (205): 0, (206): 0} | x[i] = 0 | i = 207; x = {203: 0, 204: 0, 205: 0, 206: 0, 207: 0} |
b = 2; i = 1; j = 5; s = 6.0 | s += (i / b + 1) * j | b = 2; i = 1; j = 5; s = 13.5 |
f = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] | f.append(1) | f = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] |
l = 'L'; s = 'IJK' | s += l | l = 'L'; s = 'IJKL' |
j = 101 | j += 1 | j = 102 |
c = 'a' | d[c] = d.get(c, 0) + 1 | c = 'a'; d = {'a': 1} |
g = ['9', '9', '910', '9101112131415161718192021', '910111213141516171819202122', '91011121314151617181920212223']; h = ['9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'] | g.append(''.join(h)) | g = ['9', '9', '910', '9101112131415161718192021', '910111213141516171819202122', '91011121314151617181920212223', '9101112131415161718192021222324']; h = ['9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'] |
s = 4; t = 4 | t = s | s = 4; t = 4 |
x = 12; y = 7 | x, y = y, x % y | x = 7; y = 5 |
h = 'hACKERrAN'; i = 9; s = 'HackerRank.com presents "Pythonist 2".' | h += s[i].upper() | h = 'hACKERrANK'; i = 9; s = 'HackerRank.com presents "Pythonist 2".' |
l = 3 | s = l - 1 | l = 3; s = 2 |
h = {(203): 1, (204): 0}; i = 204 | h[i] += 1 | h = {203: 1, 204: 1}; i = 204 |
a = 0; b = 'ef'; c = [[0, '-'], [6, '-'], [0, '-'], [6, '-'], [4, '-'], [0, '-'], [6, '-']] | c.append([a, b]) | a = 0; b = 'ef'; c = [[0, '-'], [6, '-'], [0, '-'], [6, '-'], [4, '-'], [0, '-'], [6, '-'], [0, 'ef']] |
n = 0.01953125 | n /= 2 | n = 0.009765625 |
h = [0, 0, 0, 0, 0, 6, 0]; i = 6; j = 4 | h[j] = i | h = [0, 0, 0, 0, 6, 6, 0]; i = 6; j = 4 |
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; i = 0; k = 3; q = [1] | q = a[i * k:i * k + k] | a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; i = 0; k = 3; q = [1, 2, 3] |
d = 'we'; i = 'we'; p = 'because' | d = i + p | d = 'webecause'; i = 'we'; p = 'because' |
l = {'D': 2, '_': 3, 'F': 1, 'Q': 1}; w = 'Q' | l.update({w: l.get(w, 0) + 1}) | l = {'D': 2, '_': 3, 'F': 1, 'Q': 2}; w = 'Q' |
a = 10; c = 0; r = [] | r.append(c + a) | a = 10; c = 0; r = [10] |
q = 2.0 | q += 1 | q = 3.0 |
j = 'a'; k = 1; s = 'ashley' | j = s[k] | j = 's'; k = 1; s = 'ashley' |
i = 0; j = 3; k = 1000000007; n = [[0, 0, 1, 4, 6, 6], [0, 0, 1, 2, 4, 4], [0, 0, 0, 1, 2, 2], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]] | z += n[i + 1][j - 1] % k | i = 0; j = 3; k = 1000000007; n = [[0, 0, 1, 4, 6, 6], [0, 0, 1, 2, 4, 4], [0, 0, 0, 1, 2, 2], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]; z = -79 |
i = 27; l = 64; m = 137438953472 | m = 1 << l - i - 1 | i = 27; l = 64; m = 68719476736 |
i = 11; o = 'cdefghmnopqrstuvw'; t = [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0] | t[ord(o[i]) - ord('a')] += 1 | i = 11; o = 'cdefghmnopqrstuvw'; t = [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0] |
g = 15; i = 0; v = [1, 2, 5, 8] | g += v[::-1][i] | g = 23; i = 0; v = [1, 2, 5, 8] |
i = 4; p = 6 | p += i | i = 4; p = 10 |