start stringlengths 5 368 | code stringlengths 5 143 | end stringlengths 5 527 |
|---|---|---|
r = 6; s = ' #####' | s = s + '#' * r | r = 6; s = ' ###########' |
g = 3 | g = g + 1 | g = 4 |
c = 2; s = [(1, 0), (1, 1), (1, 1), (1, 0), (0, 2), (0, 1), (0, 3), (2, 2), (2, 1), (2, 3)]; v = 1 | s.append((v, c - 1)) | c = 2; s = [(1, 0), (1, 1), (1, 1), (1, 0), (0, 2), (0, 1), (0, 3), (2, 2), (2, 1), (2, 3), (1, 1)]; v = 1 |
a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | a.append(0) | a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
o = 5 | o += 1 | o = 6 |
i = 4; m = [0, 2] | m.append(i) | i = 4; m = [0, 2, 4] |
l = [1, 3, 29, 16] | l.sort() | l = [1, 3, 16, 29] |
u = {'give': 0, 'one': 0}; x = 'grand' | u[x] = 0 | u = {'give': 0, 'one': 0, 'grand': 0}; x = 'grand' |
f = 0; t = [5] | f = len(t) | f = 1; t = [5] |
h = 0 | h += 1 | h = 1 |
i = 0; j = 0; l = 0; p = -1; r = 1; x = 0; y = 0 | x, y = i + r * p, j + r * l | i = 0; j = 0; l = 0; p = -1; r = 1; x = -1; y = 0 |
w = {0, 2, 3, 12}; x = 0 | w.add(x * 2) | w = {0, 2, 3, 12}; x = 0 |
d = 3 | d += 1 | d = 4 |
a = [1, 2, 1, 1, 1, 2, 1, 3] | s = sum(a) | a = [1, 2, 1, 1, 1, 2, 1, 3]; s = 12 |
b = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | b.append(0) | b = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
a = 144; b = [99, 123, 138, 155, 174, 114, 138, 153, 170, 189, 170, 187, 206, 90, 114, 129, 146, 165, 105, 129]; m = 1000 | b.append(a % m) | a = 144; b = [99, 123, 138, 155, 174, 114, 138, 153, 170, 189, 170, 187, 206, 90, 114, 129, 146, 165, 105, 129, 144]; m = 1000 |
l = [1, 1]; x = 2; y = 3 | l.append(abs(x - y)) | l = [1, 1, 1]; x = 2; y = 3 |
o = [1, 1, 1, 1, 1, 1, 2]; x = 3; y = 1 | o.append(abs(int(x) - int(y))) | o = [1, 1, 1, 1, 1, 1, 2, 2]; x = 3; y = 1 |
l = 'k'; n = '5' | n, l = [int(n), str(l)] | l = 'k'; n = 5 |
b = '1'; s = '111111111111' | s += b | b = '1'; s = '1111111111111' |
q = 'e'; u = {'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 1, 'f': 2, 'g': 2, 'h': 2} | u[q] += 1 | q = 'e'; u = {'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 2, 'f': 2, 'g': 2, 'h': 2} |
a = 8; n = 13; v = 20 | n = v - a | a = 8; n = 12; v = 20 |
i = 'chris' | z.append(i.capitalize()) | i = 'chris'; z = ['Chris'] |
n = 2; s = ['h', 'e', 'f', 'g'] | n = len(s) | n = 4; s = ['h', 'e', 'f', 'g'] |
e = 144; r = 89 | r = e | e = 144; r = 144 |
l = [[100, 1], [200, 2]]; x = 300; y = 3 | l.append([x, y]) | l = [[100, 1], [200, 2], [300, 3]]; x = 300; y = 3 |
d = ['b']; j = 'a'; k = 3; p = 'abba'; w = 1 | d = [j for j in p[k:k + w]] | d = ['a']; j = 'a'; k = 3; p = 'abba'; w = 1 |
c = 7 | m = (c - 1) / 2 | c = 7; m = 3.0 |
a = [2, 2, 4, 3]; i = 0; p = {(1): 0, (4): 1, (5): 2, (2): 4} | p[a[i]] = i | a = [2, 2, 4, 3]; i = 0; p = {1: 0, 4: 1, 5: 2, 2: 0} |
i = 32; p = 'hACKERrANK.COM PRESENTS "pYTHONI'; s = 'HackerRank.com presents "Pythonist 2".' | p = p + s[i].upper() | i = 32; p = 'hACKERrANK.COM PRESENTS "pYTHONIS'; s = 'HackerRank.com presents "Pythonist 2".' |
k = 4; n = [1, 3, 4, 5, 6, 6] | n[k] = n[k - 1] | k = 4; n = [1, 3, 4, 5, 5, 6] |
y = 5 | w = y // 2 | w = 2; y = 5 |
x = ['b', 'a'] | x.sort() | x = ['a', 'b'] |
i = 0; v = [-7330761, -6461594, -3916237, -3620601, -357920, -20, 30, 266854, 6246457, 7374819] | j = v[i + 1] - v[i] | i = 0; j = 869167; v = [-7330761, -6461594, -3916237, -3620601, -357920, -20, 30, 266854, 6246457, 7374819] |
i = 4; j = 0; x = [[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 = 1 | y = x[i][j - 1] if j >= 1 else 0 | i = 4; j = 0; x = [[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 |
n = 2; y = [0, 0, 1, 0, 0, 0] | n = y[n] | n = 1; y = [0, 0, 1, 0, 0, 0] |
c = 2; i = 1 | i += c | c = 2; i = 3 |
o = [26]; x = 91 | o.append(x) | o = [26, 91]; x = 91 |
n = 46368; u = 75025 | n = u | n = 75025; u = 75025 |
n = 4; s = 4 | t = s - (n - 2) | n = 4; s = 4; t = 2 |
i = 4; l = 0 | l = i | i = 4; l = 4 |
f = 2.0971520000000002e-15; g = 0.0 | g += f | f = 2.0971520000000002e-15; g = 2.0971520000000002e-15 |
i = 1; u = [[1, 3, 4], [2, 2, 3], [1, 2, 4]]; x = 0; y = 1 | i = u[x][y] | i = 3; u = [[1, 3, 4], [2, 2, 3], [1, 2, 4]]; x = 0; y = 1 |
b = [[-18, -12], [-10, -7]]; c = 0; j = 0; k = 0; l = 0; m = [[19, 19, -12], [5, 8, -14], [-12, -11, 9]] | w = w + (m[k + l][j + c] - b[l][c]) ** 2 | b = [[-18, -12], [-10, -7]]; c = 0; j = 0; k = 0; l = 0; m = [[19, 19, -12], [5, 8, -14], [-12, -11, 9]]; w = 1388 |
a = [2]; s = 3 | s = len(a) | a = [2]; s = 1 |
e = 5 | e = e + 1 | e = 6 |
c = 'B'; e = 'A' | e += c | c = 'B'; e = 'AB' |
j = 'Q', '2'; q = 2 | q = int(j[1]) - 1 | j = ('Q', '2'); q = 1 |
f = [2, 3]; q = [4, 3]; w = 0 | w = f[0] - q[0] | f = [2, 3]; q = [4, 3]; w = -2 |
i = 7; s = 1 | i = s | i = 1; s = 1 |
x = 3; y = 3 | y = max(0, y + x) | x = 3; y = 6 |
g = [2, 1, 2]; x = 2; y = 2; z = 0 | g = [x, y, z] | g = [2, 2, 0]; x = 2; y = 2; z = 0 |
b = ['1', '0', '1', '1', '1', '1', '1', '0']; i = 3 | b[i] = '0' | b = ['1', '0', '1', '0', '1', '1', '1', '0']; i = 3 |
a = [[[105]], [[102, 105]], [], [], [], [], [], [], []]; j = 3; r = [97, 102, 105] | a[j - 1].append(r) | a = [[[105]], [[102, 105]], [[97, 102, 105]], [], [], [], [], [], []]; j = 3; r = [97, 102, 105] |
a = 97; i = [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; v = 'e' | i[ord(v) - a] += 1 | a = 97; i = [1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; v = 'e' |
c = [1, 2, 3, 3, 2]; j = 1 | c[j + 1] = c[j] | c = [1, 2, 2, 3, 2]; j = 1 |
c = 'e'; n = Counter({'a': 2, 'b': 2, 'c': 2, 'd': 2, 'e': 1}) | n[c] += 1 | c = 'e'; n = Counter({'a': 2, 'b': 2, 'c': 2, 'd': 2, 'e': 2}) |
p = '\\d{3,}[A-Z]{2,}[0-9a-zA-Z]+$'; w = '\\d{3,}[A-Z]{2,}[0-9a-zA-Z]+$' | w = p | p = '\\d{3,}[A-Z]{2,}[0-9a-zA-Z]+$'; w = '\\d{3,}[A-Z]{2,}[0-9a-zA-Z]+$' |
c = 13 | c += 1 | c = 14 |
d = 101; k = 2 | d += k | d = 103; k = 2 |
f = ['d', 'k', 'h', 'c']; i = 2; l = 'k' | l = f[i] | f = ['d', 'k', 'h', 'c']; i = 2; l = 'h' |
i = 8; j = 2; l = [[1, 1, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 1, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]; q = [2, 5, 3, 6]; x = 0 | x = l[i - q[j]][j] if i - q[j] >= 0 else 0 | i = 8; j = 2; l = [[1, 1, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 1, 1], [1, 1, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]; q = [2, 5, 3, 6]; x = 0 |
b = 1; w = 50 | w -= b | b = 1; w = 49 |
p = 7; s = 5; v = 5; w = 7 | p = min([v, s, w]) | p = 5; s = 5; v = 5; w = 7 |
g = 1; p = [1, 3, 1, 2]; s = [1, 3]; x = 0; y = 197 | y += p[g] - s[x] | g = 1; p = [1, 3, 1, 2]; s = [1, 3]; x = 0; y = 199 |
g = 5; i = 12 | i = g | g = 5; i = 5 |
f = 2; u = [[1, 3, 4], [2, 2, 3], [1, 2, 4]]; x = 2; y = 0 | f = u[y][x] | f = 4; u = [[1, 3, 4], [2, 2, 3], [1, 2, 4]]; x = 2; y = 0 |
r = 'Such were Willarski and even the Grand Master '; x = 'of' | r += x + ' ' | r = 'Such were Willarski and even the Grand Master of '; x = 'of' |
e = [10, 5, 20, 20, 4, 5, 2, 25, 1]; i = 4; p = 5 | p = e[i] | e = [10, 5, 20, 20, 4, 5, 2, 25, 1]; i = 4; p = 4 |
n = 8; w = [[2, 3], [-1, 4], [-1, 5], [6, -1], [7, 8], [9, -1], [-1, -1], [11, 11], [-1, -1], [-1, -1], [-1, -1]]; x = 10 | w[n - 1][1] = x | n = 8; w = [[2, 3], [-1, 4], [-1, 5], [6, -1], [7, 8], [9, -1], [-1, -1], [11, 10], [-1, -1], [-1, -1], [-1, -1]]; x = 10 |
k = 'CANDY'; l = ['APPLE', 'JUICE', '10'] | k = ' '.join(l[:-1]) | k = 'APPLE JUICE'; l = ['APPLE', 'JUICE', '10'] |
a = 2; f = 3 | a *= f | a = 6; f = 3 |
b = [100, 100, 0, 0, -100, 0]; i = 4; x = 200 | x = x + b[i] | b = [100, 100, 0, 0, -100, 0]; i = 4; x = 100 |
e = 16; i = 2; l = [['11', '2', '4'], ['4', '5', '6'], ['10', '8', '-12']] | e = e + int(l[i][i]) | e = 4; i = 2; l = [['11', '2', '4'], ['4', '5', '6'], ['10', '8', '-12']] |
c = 110; l = 140 | c = l | c = 140; l = 140 |
a = 2; b = 10; h = 1407374883553360; i = 47 | h += a ^ b << i | a = 2; b = 10; h = 2814749767106642; i = 47 |
e = [0, 1, 2, 3]; t = 4 | t = e.pop() | e = [0, 1, 2]; t = 3 |
a = '10111001'; j = 8 | a = list('0' * (j - len(a)) + a) | a = ['1', '0', '1', '1', '1', '0', '0', '1']; j = 8 |
d = '111111111111' | d += '1' | d = '1111111111111' |
d = 39; z = [1, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444] | z += [d ** 2] | d = 39; z = [1, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521] |
a = 1; m = 1; x = {(1): 1, (5): 1, (3): 1} | m += x.get(a, 0) | a = 1; m = 2; x = {1: 1, 5: 1, 3: 1} |
c = 1 | c += 1 | c = 2 |
l = 0; r = 4 | m = int(l + (r - l) / 2) | l = 0; m = 2; r = 4 |
c = 'heg'; i = 0; s = ['f'] | c += s[i] | c = 'hegf'; i = 0; s = ['f'] |
r = 2 | r *= 2 | r = 4 |
e = [(0, 2), (0, 1)]; z = 1, 2 | e.append(z) | e = [(0, 2), (0, 1), (1, 2)]; z = (1, 2) |
a = '593112'; j = [1226800, 926891, 782725, 1023038, 1126293, 692565, 991612, 865649, 990565, 965414, 949248, 1168905] | j.append(int(a)) | a = '593112'; j = [1226800, 926891, 782725, 1023038, 1126293, 692565, 991612, 865649, 990565, 965414, 949248, 1168905, 593112] |
e = [1, 10]; h = 9 | e = [e[0] + 1, h] | e = [2, 9]; h = 9 |
v = 1; w = [6] | w.append(v) | v = 1; w = [6, 1] |
i = 0; s = 'hefg' | i = len(s) - 1 | i = 3; s = 'hefg' |
g = 0; j = 1 | g = j | g = 1; j = 1 |
b = 'this-is-a-string--' | b += '-' | b = 'this-is-a-string---' |
k = 'BANANA FRIES'; l = ['BANANA', 'FRIES', '12'] | q[k] = int(l[-1]) | k = 'BANANA FRIES'; l = ['BANANA', 'FRIES', '12']; q = {'BANANA FRIES': 12} |
b = ['a'] | l = b[0] if b else None | b = ['a']; l = 'a' |
c = 1; d = [0, 1, 2, 1] | d.append(c - 1) | c = 1; d = [0, 1, 2, 1, 0] |
i = 2; l = [1, 12, '5', '111', '200', '1000', '10'] | l[i] = int(l[i]) | i = 2; l = [1, 12, 5, '111', '200', '1000', '10'] |
d = [2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; i = 'g' | d[ord(i) - ord('a')] += 1 | d = [2, 2, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; i = 'g' |
i = 0; o = [98, 74, 12] | k ^= o[i] | i = 0; k = 71; o = [98, 74, 12] |
e = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987]; h = 1000000007 | e.append((e[-1] + e[-2]) % h) | e = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597]; h = 1000000007 |
z = [('a',), ('b',), ('a', 'b')] | z.sort() | z = [('a',), ('a', 'b'), ('b',)] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.