start
stringlengths 5
368
| code
stringlengths 5
143
| end
stringlengths 5
527
|
---|---|---|
p = 256; u = 1000000007 | p = p * 2 % u | p = 512; u = 1000000007 |
a = [1, 1]; b = [1, 2, 2] | b.append(a.pop(0)) | a = [1]; b = [1, 2, 2, 1] |
v = [1, 5] | h += v[0] | h = -55; v = [1, 5] |
b = '9'; c = [3, 3] | c.append(int(b)) | b = '9'; c = [3, 3, 9] |
q = ['S', 'O', 'S', 'S', 'O', 'S', 'S', 'O', 'S'] | del q[0] | q = ['O', 'S', 'S', 'O', 'S', 'S', 'O', 'S'] |
n = 2.7755575615628914e-17 | n /= 2 | n = 1.3877787807814457e-17 |
d = [31, 28, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31] | m = list(d) | d = [31, 28, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31]; m = [31, 28, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31] |
q = 1.0; x = 2 | q += x * (x - 1) / 2 | q = 2.0; x = 2 |
m = 1; n = 1000000000000 | w = n // m | m = 1; n = 1000000000000; w = 1000000000000 |
k = 8; x = 7 | x = k | k = 8; x = 8 |
n = 3; t = [1, 2, 3] | v = t[n - 1] | n = 3; t = [1, 2, 3]; v = 3 |
i = 5; s = 1 | s += i | i = 5; s = 6 |
r = [] | r.append(list()) | r = [[]] |
n = [3, 2]; p = 4; r = [5, 7] | s = n + [p] + r | n = [3, 2]; p = 4; r = [5, 7]; s = [3, 2, 4, 5, 7] |
a = 'gfedcbagfedcba'; f = 3; i = 11 | f = ord(a[i]) - 97 | a = 'gfedcbagfedcba'; f = 2; i = 11 |
w = 2 | s += w | s = -59; w = 2 |
h = '0x10'; n = 17 | h = hex(n) | h = '0x11'; n = 17 |
c = 2; i = 3 | c = i % 3 | c = 0; i = 3 |
k = 3; l = [1, 1, 1, 1, 2, 3, 4, 5, 7, 11, 16, 22, 30, 41]; n = 13 | l[n] = l[n] + l[n - k * k] | k = 3; l = [1, 1, 1, 1, 2, 3, 4, 5, 7, 11, 16, 22, 30, 43]; n = 13 |
i = 0; t = ['I', 'like', 'to', 'dance', 'I']; z = 'i ' | z += t[i + 1].lower() | i = 0; t = ['I', 'like', 'to', 'dance', 'I']; z = 'i like' |
l = ['abbab', 'ba']; u = 'hello world' | l = u.split() | l = ['hello', 'world']; u = 'hello world' |
i = 1; k = 12 | k = i | i = 1; k = 1 |
g = 2; v = [-5, -4, -3, 2, 3, 4, 5]; x = set() | x.add(v[g]) | g = 2; v = [-5, -4, -3, 2, 3, 4, 5]; x = {-3} |
a = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]; i = 18; m = 1000000007 | a.append(a[i - 1] * 2 % m) | a = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144]; i = 18; m = 1000000007 |
g = [0, 0, 1, 1, 0, 0]; i = 3; x = 2 | g[i] = x | g = [0, 0, 1, 2, 0, 0]; i = 3; x = 2 |
f = '^<[a-zA-Z][\\w\\-\\.]+@[a-zA-Z]+\\.[a-zA-Z]{1,3}>$'; p = '^<[a-zA-Z][\\w\\-\\.]+@[a-zA-Z]+\\.[a-zA-Z]{1,3}>$' | f = p | f = '^<[a-zA-Z][\\w\\-\\.]+@[a-zA-Z]+\\.[a-zA-Z]{1,3}>$'; p = '^<[a-zA-Z][\\w\\-\\.]+@[a-zA-Z]+\\.[a-zA-Z]{1,3}>$' |
i = '1'; m = 1 | m += int(i) | i = '1'; m = 2 |
b = ['r', 'l', 'd', 'w', 'o']; y = ['i', 'h'] | b = y | b = ['i', 'h']; y = ['i', 'h'] |
h = OrderedDict([('BANANA FRIES', 12), ('POTATO CHIPS', 30), ('APPLE JUICE', 20), ('CANDY', 5)]); x = ['CANDY', 5] | h[x[0]] += x[1] | h = OrderedDict([('BANANA FRIES', 12), ('POTATO CHIPS', 30), ('APPLE JUICE', 20), ('CANDY', 10)]); x = ['CANDY', 5] |
m = 1, 0; x = 0; y = -1 | x, y = m | m = (1, 0); x = 1; y = 0 |
g = 2; m = 1000000007; z = 3 | m = z - g | g = 2; m = 1; z = 3 |
a = 'bbcd'; i = 3; p = 'abdc' | a = ''.join(sorted(p[i:])) | a = 'c'; i = 3; p = 'abdc' |
e = 0, 2; x = -1; y = 2 | x, y = [e[0], e[1] + 1] | e = (0, 2); x = 0; y = 3 |
m = [0, 1, 3, 7, 15, 31, 63, 127, 255, 24287, 48575, 97151, 94303, 88607, 77215, 54431, 8863, 17727]; z = 35455 | m.append(z) | m = [0, 1, 3, 7, 15, 31, 63, 127, 255, 24287, 48575, 97151, 94303, 88607, 77215, 54431, 8863, 17727, 35455]; z = 35455 |
e = '(\\w)([\\W\\s]+)(\\w)'; p = '(\\w)([\\W\\s]+)(\\w)' | e = p | e = '(\\w)([\\W\\s]+)(\\w)'; p = '(\\w)([\\W\\s]+)(\\w)' |
v = 3; z = [3, 3] | z.append(v) | v = 3; z = [3, 3, 3] |
b = [[None, None, None, None, None, None], [None, None, None, None, None, None], [None, None, None, None, None, None], [None, None, None, None, None, None], [None, None, None, None, None, None], [None, None]]; i = 5 | b[i].append(None) | b = [[None, None, None, None, None, None], [None, None, None, None, None, None], [None, None, None, None, None, None], [None, None, None, None, None, None], [None, None, None, None, None, None], [None, None, None]]; i = 5 |
a = 266854; b = 6246457; n = 266824 | n = b - a | a = 266854; b = 6246457; n = 5979603 |
k = 1; n = 5 | q = n * k | k = 1; n = 5; q = 5 |
r = [['1', '5', '3']] | k = r[0] if r else None | k = ['1', '5', '3']; r = [['1', '5', '3']] |
b = 'SALLY' | d = len(b) | b = 'SALLY'; d = 5 |
i = 0, 1, 2; j = 1; k = [7, 8, 9]; q = 25 | q += k[i[j]] ** 2 | i = (0, 1, 2); j = 1; k = [7, 8, 9]; q = 89 |
a = ['Robert', 'Bustle', '32', 'M']; i = 2; p = [['Mr. Mike Thomson', 20], ['Mr. Robert Bustle', 32], 'Andria Bustle 30 F'] | a = p[i].strip().split() | a = ['Andria', 'Bustle', '30', 'F']; i = 2; p = [['Mr. Mike Thomson', 20], ['Mr. Robert Bustle', 32], 'Andria Bustle 30 F'] |
j = 4; v = [4, 0, 3, 1, 2]; x = [4, 0, 3, 1, 2] | x = v[:j] | j = 4; v = [4, 0, 3, 1, 2]; x = [4, 0, 3, 1] |
i = 7; n = [0, 1, 1, 2, 3, 5, 8] | n.append(n[i - 1] + n[i - 2]) | i = 7; n = [0, 1, 1, 2, 3, 5, 8, 13] |
i = 2; l = [2, 2, 0, 0]; t = [2, 0, 0, 0] | l[i] = l[i - 1] + t[i] | i = 2; l = [2, 2, 2, 0]; t = [2, 0, 0, 0] |
i = 1; j = 1; x = [[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, 0]] | x[i][j] = 1 | i = 1; j = 1; x = [[1, 0, 0, 1, 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]] |
p = -1 | p *= -1 | p = 1 |
d = [0] | days = max(days, d.pop()) | d = []; l = 76 |
i = 5; j = [2, 4, 6, 9, 3, '7', '16', '10', '5'] | j[i] = int(j[i]) | i = 5; j = [2, 4, 6, 9, 3, 7, '16', '10', '5'] |
i = 10; s = '999100010001'; w = '999100010' | w = s[0:i] | i = 10; s = '999100010001'; w = '9991000100' |
k = 1; n = [0, 1] | n.append(n[-1] + k) | k = 1; n = [0, 1, 2] |
f = 1; y = '3' | f = len(y) | f = 1; y = '3' |
a = 3 | a += 1 | a = 4 |
g = 2; p = 1 | p = g | g = 2; p = 2 |
h = 95 | h += 1 | h = 96 |
i = 11; j = 20; o = 27 | o = i ^ j | i = 11; j = 20; o = 31 |
b = [(1, 2), (-2, -2), (-2, -2)]; i = 1; l = -2; r = -2 | l, r = b[i] | b = [(1, 2), (-2, -2), (-2, -2)]; i = 1; l = -2; r = -2 |
h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 3] | h = [0] * 27 | h = [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 = 2; z = [1, 10] | z.append(10 ** 2 ** (i - 1)) | i = 2; z = [1, 10, 100] |
b = [0, 1, 3, 0, 4, 1, 7, 0, 8, 1, 11, 0, 12, 1, 15, 0, 48, 1, 51, 0, 52, 1, 55, 0, 56, 1, 59, 0, 60]; x = 61 | b.append(b[-1] ^ x) | b = [0, 1, 3, 0, 4, 1, 7, 0, 8, 1, 11, 0, 12, 1, 15, 0, 48, 1, 51, 0, 52, 1, 55, 0, 56, 1, 59, 0, 60, 1]; x = 61 |
j = -1; w = [3, 3, 4, 5, 6, 7]; y = 2 | w[j + 1] = y | j = -1; w = [2, 3, 4, 5, 6, 7]; y = 2 |
a = 1; m = 1 | m += a | a = 1; m = 2 |
n = {0, 1}; s = 2 | n.add(s) | n = {0, 1, 2}; s = 2 |
z = '10000000000000000000000000000' | z += '0' | z = '100000000000000000000000000000' |
e = '11111111' | e += '1' | e = '111111111' |
s = 'D'; w = 10; z = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} | w = z.get(s) | s = 'D'; w = 500; z = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} |
i = 1; j = 2; s = [0, 1, 2, 3] | s[j] = i | i = 1; j = 2; s = [0, 1, 1, 3] |
i = 2; j = 70 | j += i | i = 2; j = 72 |
j = 30; l = 1.9999999422580004; r = 2 | l = l + j * r ** -j | j = 30; l = 1.9999999701976776; r = 2 |
m = [0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]; x = 9 | m[x] += 1 | m = [0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]; x = 9 |
s = 'ashle' | s = s[:-1] | s = 'ashl' |
b = 329921424; m = 1000000007; r = 819182210 | r = r * b % m | b = 329921424; m = 1000000007; r = 346806727 |
b = [1]; t = 33; x = 2 | t += b[-1] * (x + 1) | b = [1]; t = 36; x = 2 |
i = 'e'; u = ['a', 'b', 'c', 'd'] | u.append(i) | i = 'e'; u = ['a', 'b', 'c', 'd', 'e'] |
c = 'y'; x = 'r' | x = c.lower() | c = 'y'; x = 'y' |
p = [2, 6, 30, 210, 2310]; y = 30030 | p += [y] | p = [2, 6, 30, 210, 2310, 30030]; y = 30030 |
j = 3; s = """2\n3\n1 3\n4\n2 2 2\n\n\n\n""" | s = s * j | j = 3; s = '2\n3\n1 3\n4\n2 2 2\n\n\n\n2\n3\n1 3\n4\n2 2 2\n\n\n\n2\n3\n1 3\n4\n2 2 2\n\n\n\n' |
i = 2; k = [0, 1, 0, 0]; v = 3 | k[v] = i | i = 2; k = [0, 1, 0, 2]; v = 3 |
k = 2; l = [1, 0] | l.append(k) | k = 2; l = [1, 0, 2] |
q = [0, 0, 0, 0, 0] | q.append(0) | q = [0, 0, 0, 0, 0, 0] |
i = 2; l = ['4', '.']; s = '4.0O0' | l.append(s[i]) | i = 2; l = ['4', '.', '0']; s = '4.0O0' |
n = 1 | s = max(s, n) | n = 1; s = 1 |
a = 'HackerRank.com presents "Pythonist 2".'; b = ['h', 'A', 'C', 'K', 'E', 'R', 'r', 'A', 'N', 'K', '.', 'C', 'O', 'M', ' ', 'P', 'R']; i = 17 | b.append(chr(ord(a[i]) - 32)) | a = 'HackerRank.com presents "Pythonist 2".'; b = ['h', 'A', 'C', 'K', 'E', 'R', 'r', 'A', 'N', 'K', '.', 'C', 'O', 'M', ' ', 'P', 'R', 'E']; i = 17 |
c = 1; r = 1; y = [['2', '1', '0', '0', '0', '0'], ['2', '0', '0', '0', '1', '0']] | y[r][c] = '2' | c = 1; r = 1; y = [['2', '1', '0', '0', '0', '0'], ['2', '2', '0', '0', '1', '0']] |
i = 2; k = ['c', 'h']; w = ['d', 'k', 'h', 'c'] | k = sorted(list(set(w[len(w) - i - 1:]))) | i = 2; k = ['c', 'h', 'k']; w = ['d', 'k', 'h', 'c'] |
n = 4; s = ['0', '0', '1', '1'] | f = list(s[:n // 2]) | f = ['0', '0']; n = 4; s = ['0', '0', '1', '1'] |
a = 2; g = 3 | a = a * g % modPart | a = -8; f = -14; g = 3 |
c = [30, 0, 0, 0, 0]; i = 0; j = 0; k = 4; l = [10, 20, 30, 40, 50]; s = [[1, 1, 0, 0, 1], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]]; t = 5 | c[(j + i) % t] += s[j][k] * l[(k + i) % t] | c = [80, 0, 0, 0, 0]; i = 0; j = 0; k = 4; l = [10, 20, 30, 40, 50]; s = [[1, 1, 0, 0, 1], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1]]; t = 5 |
b = '01011001'; i = 7 | b = b[:i] + '0' + b[i + 1:] | b = '01011000'; i = 7 |
i = 3 | a.append(i) | a = [3]; i = 3 |
g = {}; s = 1 | g[s] = 0 | g = {1: 0}; s = 1 |
r = '1111111111111111111' | r += '1' | r = '11111111111111111111' |
a = 6; b = 9 | a, b = b, a % b | a = 9; b = 6 |
j = 3; l = 3 | l += j | j = 3; l = 6 |
p = '(?<=\\w)[!@#$%& ]+(?=\\w)'; w = '(?<=\\w)[!@#$%& ]+(?=\\w)' | w = p | p = '(?<=\\w)[!@#$%& ]+(?=\\w)'; w = '(?<=\\w)[!@#$%& ]+(?=\\w)' |
n = 3; p = 0; r = [[1]]; y = 0 | n += r[p][y] | n = 4; p = 0; r = [[1]]; y = 0 |
i = 3; j = 1; k = 1 | i = i + j + k + 1 | i = 6; j = 1; k = 1 |
b = 'AABCBC'; e = ''; i = 0 | e = b[i + 1] if i + 1 in range(len(b)) else '' | b = 'AABCBC'; e = 'A'; i = 0 |
x = 14 | x += 1 | x = 15 |