Skip to content

Category Archives: Algorithms

Given an array nums[] of size N, the task is to check whether the given array can be converted into a permutation of 1 to… Read More
Given an array arr[] of size N, the task is to find the count of subarrays with elements in alternate increasing-decreasing order or vice-versa. A… Read More
Given an array arr[], consisting of N positive integers. The task is to minimize the difference between the maximum and the minimum element of the… Read More
Cache oblivious is a way of achieving algorithms that are efficient in arbitrary memory hierarchies without the use of complicated multi-level memory models. Cache oblivious… Read More
Given a number N and an integer K, the task is to set the Kth bit of the number N, i.e., if the Kth bit… Read More
Given a positive integer N, the task is to find Nth term of the series- 3, 5, 9, 17, 33…till N terms Examples: Input: N… Read More
Given a binary string s and an array ct[] of even size. The task is to minimize the cost of operations to: Convert string s… Read More
Given two numbers N and r, find the value of NCr using recursion Examples: Input: N = 5, r = 2Output: 10Explanation: The value of… Read More
Given a binary matrix arr[][] having N rows and M columns, the task is to calculate the minimum number of operations required to set the… Read More
Given an integer N, the task is to calculate the maximum number of times N can be divided by an integer K, where K is… Read More
Given a binary integer N, the task is to convert it into base 6. Note: The number of bits in N is up to 100. … Read More
Given two integers A and B, the task is to find a triplet (X, Y, Z) such that all of them are divisible by A,… Read More
Given string str having N characters representing an integer, the task is to calculate the sum of all possible prefixes of the given string. Example:… Read More
Given an array arr[] of N intervals, the task is to calculate the index of the closest interval to the right of each of the… Read More
Given an array arr[] of size N and a positive integer K, the task is to maximise difference between the largest element and the smallest… Read More

Start Your Coding Journey Now!