Skip to content

Category Archives: Algorithms

Given two strings S1 and S2 of the same length containing characters ranging from ‘0’ to ‘9’, the task is to return the minimum number… Read More
Given a positive integer N. The task is to print the array in decreasing order in which the numbers are odd powers of 2  and… Read More
Given two Integers N and X in which N is the total number of elements of the series that starts with X (say A). The… Read More
Given a binary tree and an integer K, the task is to write a program to count the number of nodes such that the path… Read More
Given a binary string consisting of ‘0’ and ‘1’ only and an integer K, the task is to minimize the string as far as possible… Read More
Given a 4-digit number with at least two distinct digits, Your program should perform the following operations on the number:  Arrange the digits in descending… Read More
Given a binary tree and a node start that is initially infected. For every second, neighbours of an infected node get infected. The task is… Read More
Given a 2D array arr[][] of size N * M, the value in arr[][] represents the value of coins, the task is to maximize the… Read More
Given N nodes, where each of them is numbered from 0 to N – 1, and array edges, where there is a directed edge from… Read More
Given an array of strings arr[] of length N, the task is to sort the strings in Lexicographical order. Examples: Input: arr[] = {“batman”, “bat”,… Read More
Given an array A[] of size N, the task is to find the total number of positions in all the subarrays such that the value… Read More
Given an array arr[] of size N that contains -1 and all positive integers, the task is to modify the array and print the final… Read More
Given an array of positive integers arr[] of length N and a query array query[] of length M, the task is to find the maximum… Read More
Given an array A[] of N positive integers and 3 integers X, Y, and Z, the task is to check if there exist 4 indices… Read More
These are the special type of recursive functions, where the last statement executed inside the function is the call to the function itself. Advantages of… Read More

Start Your Coding Journey Now!