You are given an integer array nums. You are initially positioned at the array’s first index, and each element in the array represents your maximum jump length at that position.
This problem could be solved in O(N) time complexity, where N is the maximum of the given two strings length. We could start traversing the two strings from the last and keep calculating the sum of each string’s character ie ‘0’ and ‘1’. If there’s a carry propagate it to the sum of the next digits in iteration.
Given a NxN matrix with 0s and 1s. A block with value 1 can be used to travel ahead in the matrix. Now, consider mat[0][0] as the starting point for the rat.
Given an integer array nums of size n, return the minimum number of moves required to make all array elements equal. In one move, you can increment n – 1 elements of the array by 1.
You are climbing a staircase. It has n steps upto the top. Each time you can either climb 1 step or 2 steps. You’ve to find the number of ways to climb the stair.
Given two non-negative integers a and b, you’ve to find the Greatest Common Divisor (GCD) or Highest Common Factor (HCF) of the two numbers. In other words, find the largest number that divides them both. The Euclidean algorithm is one of the oldest numerical algorithms to compute the greatest common divisor (gcd) of two positive integers.