# Category Archives: Algorithms

Given an array arr[] having N integers, and an integer K, the task is to find an array such that it contains a single elements… Read More
Given an array Arr[], the task is to find out the minimum number of operations to make the sum of array elements lesser or equal… Read More
Given a tree of having N nodes rooted at node 0, and an array val[] denoting the value at each node, the task is to… Read More
Given an array arr[] of size N, the task is to maximize the array sum by subtracting the absolute values of all odd and adding… Read More
Given an integer N, find the number of natural numbers less than or equal to N and have 4 factors. Example:  Input: N = 8Output:… Read More
Given a binary array arr[] of size N and an integer K, the task is to find the highest index which can be reached in… Read More
Given an array arr[] of size N, an integer K and Q queries, each of form {x, l, r}. For each query, the task is… Read More
Given an integer N, the task is to generate an array arr[] having N positive integers such that arr[i] ≠ arr[j] if j is divisible… Read More
Given integers L and R, the task is to find the number of integers in range [L, R] (say X) which does not form a… Read More
Given an array A[] of size N and a digit K. Find the number of sub-sequences of the array where the last digit of the… Read More
Given an integer K, the task is to find three distinct integers A, B and C such that  ( A ∣ B ) & (… Read More
Given a positive integer N. Find the minimum number of operations needed to reduce N to 0 when N can reduced by its divisor at… Read More
Given two integers N, Y, generate a permutation of length N such that sum of all prefix minimum of that permutation is Y. Example:  Input:… Read More
Given integers N and K, the task is to find the number of factors of NCK. Since the answer can be very large return the… Read More
Given the root of a binary tree in which all nodes has values either 0 or 1, the task is to check if the level-wise… Read More