## Print numbers in descending order along with their frequencies

Given an array arr, the task is to print the elements of the array in descending order along with their frequencies. Examples: Input: arr[] =… Read More »

## Find sum of a number and its maximum prime factor

Given an integer N, the task is to find the sum of N and it’s maximum prime factor. Examples: Input: 19 Output: 38 Maximum prime… Read More »

## Largest number less than N with digit sum greater than the digit sum of N

Given an integer N, the task is to find the greatest number less than N such that the sum of its digits is greater than… Read More »

## Count numbers from range whose prime factors are only 2 and 3

Given two positive integers L and R, the task is to count the elements from the range [L, R] whose prime factors are only 2… Read More »

## Use of FLAG in programming

Flag variable is used as a signal in programming to let the program know that a certain condition has met. It usually acts as a… Read More »

## Print numbers with digits 0 and 1 only such that their sum is N

Given a number N, the task is to find the required numbers consist of only 0 and 1 digit whose sum is equal to N.… Read More »

## Frequency of each element of an array of small ranged values

Given an array where elements in small range. The maximum element in the array does not go beyond size of array. Find frequencies of elements.… Read More »

## Minimum sum of the elements of an array after subtracting smaller elements from larger

Given an array arr, the task is to find the minimum sum of the elements of the array after applying the following operation: For any… Read More »

## Problem of 8 Neighbours of an element in a 2-D Matrix

Given a 2-D Matrix and an integer ‘K’, the task is to predict the matrix after ‘K’ iterations given as follows: An element 1 in… Read More »

## Find three integers less than or equal to N such that their LCM is maximum

Given a number N(>=3). The task is to find the three integers (<=N) such that LCM of these three integers is maximum. Examples: Input: N… Read More »

## Count number of triplets (a, b, c) such that a^2 + b^2 = c^2 and 1 <= a <= b <= c <= n

Given an integer N, the task is to count the number of triplets (a, b, c) such that a2 + b2 = c2 and 1… Read More »

## Find a point that lies inside exactly K given squares

Given an integer K and an array arr each of whose element x represents a square with two of its vertices as (0, 0) and… Read More »

## String which when repeated exactly K times gives a permutation of S

Given an integer K and a string str of lowercase English characters, the task is to find a string s such that when s is… Read More »

## Maximum length substring with highest frequency in a string

Given a string. The task is to find the maximum occurred substring with a maximum length. These occurrences can overlap. Examples: Input: str = “abab”… Read More »

## Sum of the digits of a number N written in all bases from 2 to N/2

Given an integer N, the task is to find the sum of the digits of the number N written in all the bases from 2… Read More »