# Category Archives: Algorithms

## Minimum minutes needed to make the time palindromic

Given a string str which stores the time in the 24 hours fomat as “HH:MM”. The task is to find the minimum minutes needs to… Read More »

## Make the string in AP by changing a character

Given a string S that consists of letters such that their ASCII values follow an Arithmetic Progression. The task is to find the letter and… Read More »

## Maximum profit by buying and selling a stock at most twice | Set 2

Given an array prices[] which denotes the prices of the stocks on different days, the task is to find the maximum profit possible for buying… Read More »

## Convert string to integer without using any in-built functions

Given a string str, the task is to convert the given string into the number without using any inbuilt function. Examples:  Input: str = “985632”… Read More »

## Permutation of Array such that sum of adjacent elements are not divisible by 3

Given an array arr[] of positive integers, the task is to find the permutation of the array such that sum of adjacent elements is not… Read More »

## Find N random points within a Circle

Given four integers N, R, X, and Y such that it represents a circle of radius R with [X, Y] as coordinates of the center.… Read More »

## Maximum sum of values in a given range of an Array for Q queries when shuffling is allowed

Given an array arr[] and K subarrays in the form (Li, Ri), the task is to find the maximum possible value of . It is… Read More »

## Check if ceil of number divided by power of two exist in sorted array

Given a sorted array arr[] and an integer K, the task is to check if there exists a ceil of number K divided by some… Read More »

## Count of unique digits in a given number N

Given a number N, the task is to count the number of unique digits in the given number. Examples: Input: N = 22342 Output: 2 Explanation:The digits… Read More »

## Maximum number of objects that can be created as per given conditions

Given N items of type-1 and M items of type-2. An object can be created from 2 items of type-1 and 1 item of type-2… Read More »

## Maximum profit such that total stolen value is less than K to get bonus

Given an integer K and an array arr[] which denotes the amount that can be stolen, the task is to choose a subset of items… Read More »

## Length of longest subsequence in an Array having all elements as Nude Numbers

Given an array arr[] of N positive integers, the task is to print the length of the longest subsequence of the array such that all… Read More »

## Find initial integral solution of Linear Diophantine equation if finite solution exists

Given three integers a, b and c representing a linear equation of the form: ax + by = c. The task is to find the… Read More »

## Maximum score of deleting an element from an Array based on given condition

Given an array arr[], the task is to find the maximum score of deleting an element where each element of the array can be deleted… Read More »

## Count of numbers upto N having absolute difference of at most K between any two adjacent digits

Given an integer N, the task is to count the numbers up to N having an absolute difference of at most K between any two… Read More »