What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-25 20:05:04
kitty's calculations on a tree hackerrank solution
from collections import Counter, defaultdict MOD = 10**9 + 7 def read_row(): return (int(x) for x in input().split()) def mul(x, y): return (x * y) % MOD def add(*args): return sum(args) % MOD def sub(x, y): return (x - y) % MOD n, q... Add solution -
Python 2022-02-23 03:20:02
2d array python
matrix = [input().split() for i in range(no_of_rows)] # if only row is given and the number of coloumn has to be decide by user matrix= [[input() for j in range(no_of_cols)] for i in range(no_of_rows)] # if both row and coloumn has been taken as input fro... Add solution -
-
Python 2022-02-01 04:20:03
collecting candies codevita solution in python
T = int(input()) arr1 = [] for i in range(0, T): N = int(input()) arr = list(map(int,input().split())) arr.sort() count = arr[0] for i in range(1, len(arr)): count = count + arr[i] arr1.append(count) print(sum(arr1)) Add solution