Recursion: Check if a number is palindrome using recursion
Problem Statement: Given an integer “n”, you need to check if the number is palindrome or not. A number when reversed, will…
Recursion: Power of three
Problem Statement: You are given a number, return true if its a power of three else return false. Example: Input: n = 27 Output: true Solution…
Recursion: Given two numbers, add them recursively
Problem Statement: You are given 2 numbers. You need to perform bitwise recursive addition of the 2 integers. Example: Input: a = 20 b = 30…
Recursion: Reverse the queue using recursion
Problem Statement: Reverse the queue using recursion Example: Input: queue = [1, 2, 3, 4] Output: res = [4, 3, 2, 1] Solution Explanation:…
Recursion: Convert a given decimal number into binary using recursion
Problem Statement: You are given a decimal number, you need to convert into binary number using recursion. Example: Input: 15 Output: 1111…
Matrix: Given a matrix, set it to zero
Problem Statement: You are given a matrix. You need to set the entire row and column as zero if an element is zero. Example: Input: [[2, -5,…
Matrix: Given a 2D matrix, find the peak element.
Problem Statement: You are given a 2D matrix of size n * m, you need to find the peak element. An element is a peak element if it is greater…
Matrix: Given a matrix, count zero in row wise and column wise matrix
Problem Statement: You are given a 2D matrix of size n * n where all the elements are 0 or 1. They are sorted in ascending order. You need to…
Matrix: Given a matrix, you need to count the number of rows and columns whose sum equal to diagonal sum
Problem Statement: Given a 2D matrix of size n*n. You need to count the number of rows and columns whose sum equal to diagonal sum Example:…