All problems

Determine Greatest Common Divisor

The greatest common divisor (GCD), also called highest common factor (HCF) of N numbers is the largest positive integer that divides all numbers without giving a remainder.

Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).

Coin Change

You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.

Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.

Defanging an Ip Address

Given a valid (IPv4) IP address, return a defanged version of that IP address.

Coin Sum

You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.

Maximum Depth of N Ary Tree

Given a n-ary tree, find its maximum depth.

Partition to K Equal Sum Subsets

Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all equal.

Array Chunking

Given an array and a size, split the array items into a list of arrays of the given size.

Staircase

Consider a staircase of size n=4: # ## ### #### Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces.

Prison Cells After N Days

There are 8 prison cells in a row, and each cell is either occupied or vacant.

Maximum Gap

Given an unsorted array, find the maximum difference between the successive elements in its sorted form.