## Numbers with sum of digits equal to the sum of digits of its all prime factor

Given a range, the task is to find the count of the numbers in the given range such that the sum of its digit is… Read More »

Given a range, the task is to find the count of the numbers in the given range such that the sum of its digit is… Read More »

Given two lists that contains cost prices CP[] and selling prices SP[] of products respectively. The task is to maximize the profit by selling at-most… Read More »

Given a rectanglular floor of (M X N) meters is to be paved with square tiles of (s X s). The task is to find… Read More »

Given a Linked List and a number K. The task is to print the value of the K-th node from the middle towards the beginning… Read More »

Given an array of list of commands U(Up), D(Down), L(Left) and R(Right) and initial cell position (x, y) in a matrix. Find the final cell… Read More »

Given an array of size n, arrange the first k elements of the array in ascending order and the remaining n-k elements in descending order.… Read More »

This is an extension of the median of two sorted arrays of equal size problem. Here we handle arrays of unequal size also. Examples: Input… Read More »

TL;DR In this article I’m trying to explain the difference/similarities between dynamic programing and divide and conquer approaches based on two examples: binary search and… Read More »

Given a number N. The task is to find the number of permutations of 1 to N such that no three terms of the permutation… Read More »

Given an array arr[] containing numbers from 0 to 9 only, the task is to form the minimum possible number from the given digits and… Read More »

Given an integer N, the task is to print all the substring of N without doing any conversion i.e converting it into a string or… Read More »

One’s Complement of an Integer 1’s and 2’s complement of a Binary Number In this post, a general method of finding complement with any arbitrary… Read More »

Given an Octal number N. The task is to write a program to check if the Decimal representation of the given octal number N is… Read More »

Given a number N. The task is to write a program to find the N-th term in the below series: 0, 2, 1, 3, 1,… Read More »

Given an array of distinct integers(considering only positive numbers) and a number ‘m’, find the number of triplets with the product equal to ‘m’. Examples:… Read More »