## Longest subsequence such that absolute difference between every pair is atmost 1

Given an integer array arr[] of size N, the task is to find the longest subsequence S such that for every a[i], a[j] ∈ S… Read More »

- Sorting a Map by value in C++ STL
- Real-time application of Data Structures
- Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
- Check if given words are present in a string
- Count of subarrays having exactly K perfect square numbers
- Kth most frequent Character in a given String
- Count of substrings of length K with exactly K distinct characters
- LRU Cache in Python using OrderedDict
- Count triplets such that sum of any two number is equal to third | Set 2
- CamelCase Pattern Matching
- Length of the smallest substring which contains all vowels
- Remove odd frequency characters from the string
- Longest permutation subsequence in a given array
- Check if an Array is a permutation of numbers from 1 to N
- Longest increasing sub-sequence formed by concatenating array to itself N times
- Quadratic Probing in Hashing
- Count of greater elements for each element in the Array
- Find k most frequent in linear time
- Count the elements having frequency equals to its value
- Count triplets in an array such that i<j<k and a[j] - a[i] = a[k] - a[j] = D
- Minimum number of Water to Land conversion to make two islands connected in a Grid
- Count of subarrays whose sum is a perfect square
- Program to implement Separate Chaining in C++ STL without the use of pointers
- Maximum sum subarray having sum less than or equal to given sum using Set
- Shortest subarray to be removed to make all Array elements unique
- Lexicographical smallest number after at most K consecutive swaps
- Count distinct substrings of a string using Rabin Karp algorithm
- Sum and product of K smallest and largest Fibonacci numbers in the array
- Smallest subarray from a given Array with sum greater than or equal to K
- Replace each element of Array with it's corresponding rank

Given an integer array arr[] of size N, the task is to find the longest subsequence S such that for every a[i], a[j] ∈ S… Read More »

Given an array arr containing non-negative integers, the task is to print the length of the longest subsequence of Fibonacci numbers in this array. Examples:… Read More »

Given an array of integers arr of size N, the task is to find the sum of the elements which have composite frequencies in the… Read More »

Given string str of size N, the task is to remove all the characters from the string that have odd frequencies. Examples: Input: str =… Read More »

Given an array arr containing N positive integers, the task is to check if the given array arr represents a permutation or not. A sequence… Read More »

Given an array arr containing integers of size N, the task is to delete all the elements from the array that have odd frequencies. Examples:… Read More »

Given a string of lowercase letters str of length N, the task is to reduce it by removing the characters which appear exactly K times… Read More »

Pre-requisites: Java Collection Framework. 1. What is the Output of following Java Program? filter_none edit close play_arrow link brightness_4 code import java.util.*; class Demo… Read More »

Given an array arr[], the task is to find the largest number in given Array, formed by repeatedly combining two same elements. If there are… Read More »

Given a string S, the task is to find the count of maximum repeated frequency of characters in the given string S. Examples: Input: S… Read More »

Given an array of distinct positive integers arr[] of length N, the task is to count all the triplets such that sum of two elements… Read More »

Given a natural number N, the task is to find the next number having distinct digits from the given number. Examples: Input: N = 19… Read More »

Given a string S, the task is to find the prefix of string S with the maximum possible length such that frequency of each character… Read More »

Given an array arr[] of N integers, the task is to find the longest subarray where all numbers in that subarray are prime. Examples: Input:… Read More »