Recursion Power Sum

def powerSum(X, N, num=1): power = num ** N⛶if power > X: return 0 # too big, can't continue elif power == X: return 1 # exact match found else: # either include this number or ...
0 Read More

2780. Minimum Index of a Valid Split

2780. Minimum Index of a Valid SplitDifficulty: MediumTopics: Array, Hash Table, SortingAn element x of an integer array arr of length m is dominant if more than half the elements of arr have a value ...
0 Read More