## Find maximum distance between any city and station

Given the number of cities n numbered from 0 to n-1 and the cities in which stations are located, the task is to find the… Read More »

- How can one become good at Data structures and Algorithms easily?
- Understanding The Coin Change Problem With Dynamic Programming
- Subset array sum by generating all the subsets
- Make all numbers of an array equal
- Reach the numbers by making jumps of two given lengths
- Some useful C++ tricks for beginners in Competitive Programming
- Check if a number is perfect square without finding square root
- Sum of XOR of all subarrays
- Sum of the first N Prime numbers
- Sort the array of strings according to alphabetical order defined by another string
- Sum of similarities of string with all of its suffixes
- Length of the longest Subarray with only Even Elements
- Check if it is possible to reach a number by making jumps of two given length
- Find the number in a range having maximum product of the digits
- Make Binary Search Tree
- Print matrix in snake pattern from the last column
- Maximum of all Subarrays of size k using set in C++ STL
- Smallest Pair Sum in an array
- Number of array elements derivable from D after performing certain operations
- Count distinct substrings that contain some characters at most k times
- Minimum number of sets with numbers less than Y
- Count the number of vowels occurring in all the substrings of given string
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Operations required to make the string empty
- Find two numbers whose divisors are given in a random order
- Sum of the multiples of two numbers below N
- Number of subarrays have bitwise OR >= K
- Remove characters from a numeric string such that string becomes divisible by 8
- Program to find the kth character after decrypting a string
- Maximum length substring with highest frequency in a string

Given the number of cities n numbered from 0 to n-1 and the cities in which stations are located, the task is to find the… Read More »

Given a binary array consisting of only zeroes and ones. The task is to find: The number of subarrays which has only 1 in it.… Read More »

Given a number N. The task is to find the sum of all multiples of 2 and 5 below N ( N may be up… Read More »

Given a number N, find the smallest prime divisor of N. Examples: Input: 25 Output: 5 Input: 31 Output: 31 Recommended: Please try your approach… Read More »

Given an array of integers arr, the task is to count the number of inversions in the array. If A[i] > A[j] and i <… Read More »

Given an array of integers. The task is to calculate the product of all the composite numbers in an array. Note: 1 is neither prime… Read More »

Given a string str, the task is to find the lexicographically smallest string that can be formed by removing at most one character from the… Read More »

Given an array of N integers and a number K, the task is to find the number of subarrays such that all elements are greater… Read More »

Given an array with n elements. The task is to find the maximum number of contiguous array elements which have the same number of set… Read More »

Given an array of N integers and a number K, the task is to find the length of the longest subarray in which all the… Read More »

Given an array of N integers and a number X, the task is to find the number of segments such that all elements in the… Read More »

Given an array of integers, remove the elements from the array whose frequency lies in the range [l, r]. Examples: Input : arr[] = {… Read More »

Given an array of integers, find the k smallest numbers after deleting given elements. In case of repeating elements delete only one instance in the… Read More »

Given an array of integers, find the k largest number after deleting the given elements. In case of repeating elements, delete one instance for every… Read More »

S is string containing only lowercase English alphabets. We need to find if there exists at least one palindromic sub-string whose length is even. Examples:… Read More »