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

GeeksforGeeks : M Coloring Problem

Problem https://www.geeksforgeeks.org/problems/m-coloring-problem-1587115620/1You are given an undirected graph consisting of v vertices and a list of edges, along with an integer m. Your tas...
0 Read More

Leetcode 148 : Sort List

Problem Statement https://leetcode.com/problems/sort-list/description/Given the head of a linked list, return the list after sorting it in ascending order. Sample Test Cases Example 1...
0 Read More