## Rearrange characters to form palindrome if possible

Given a string, convert the string to palindrome without any modifications like adding a character, removing a character, replacing a character etc. Examples: Input :… Read More »

Given a string, convert the string to palindrome without any modifications like adding a character, removing a character, replacing a character etc. Examples: Input :… Read More »

Given an array of n integers, find the sum of f(a[i], a[j]) of all pairs (i, j) such that (1 <= i < j <=… Read More »

Given an interval [x, y]. Find the divisor that occurs maximum number of times except ‘1’ in the divisors of numbers in the range [x,… Read More »

Given a n x n matrix of integers. The problem is to find the largest area rectangular sub-matrix having sum divisible by the given value… Read More »

Prerequisite – Inorder/preorder/postorder traversal of tree Given a binary tree, perform postorder traversal. Recommended: Please try your approach on {IDE} first, before moving on to… Read More »

Given a linked list, find its first non-repeating integer element. Examples: Input : 10->20->30->10->20->40->30->NULL Output :First Non-repeating element is 40. Input :1->1->2->2->3->4->3->4->5->NULL Output :First Non-repeating… Read More »

Given an array A of n elements. We need to change the array into a permutation of numbers from 1 to n using minimum replacements… Read More »

Given an array of n string containing lowercase letters. Find the size of largest subset of string which are anagram of each others. An anagram… Read More »

Given a decimal number n without floating point. The problem is to convert the decimal number to octal number with minimum use of arithmetic operators.… Read More »

Given an array arr[] containing n integers. The problem is to find the length of the longest strict bitonic subsequence. A subsequence is called strict… Read More »

Given two same sized arrays A[] and B[] (both arrays contain distinct elements individually but may have some common elements), task is to form a… Read More »

Pre-requisite : std::map, std::unordered_map When it comes to efficiency, there is a huge difference between maps and unordered maps. We must know the internal working… Read More »

Given an array that might contain duplicates, find the element whose last appearance is latest. Examples: Input : arr[] = {10, 30, 20, 10, 20}… Read More »

Given an array of N integers and an integer K, pick two distinct elements whose sum is K and find the maximum shortest distance of… Read More »

There is a given binary matrix, we need to find if there exists any rectangle or square in the given matrix whose all four corners… Read More »