##
Length of Longest Balanced Subsequence
October 19, 2017

Given a string S, find the length of longest balanced subsequence in it. A balanced string is defined as:- A Null string is a balanced… Read More »

October 19, 2017

Given a string S, find the length of longest balanced subsequence in it. A balanced string is defined as:- A Null string is a balanced… Read More »

Given n strings, find the common characters in all the strings. In simple words, find characters that appear in all the strings and display them… Read More »

October 17, 2017

Given a lowercase string A of length N and an integer K, find the lexicographically smallest string B of the same length as A such… Read More »

October 16, 2017

iven a number n, count number of strings of length n such that every string has adjacent characters with difference between ASCII values as 1.… Read More »

A stringstream associates a string object with a stream allowing you to read from the string as if it were a stream (like cin). Basic… Read More »

October 14, 2017

Given a string S and an integer K. The task is to find lexicographically largest subsequence of S, say T, such that every character in… Read More »

October 11, 2017

Print the shortest sub-string of a string containing all the given words. In the first example, two solutions are possible: “world is here. this is… Read More »

Given a 6 digit number, calculate the minimum number of digits that needs to be replaced in order to make the number magical. The number… Read More »

October 10, 2017

Given a binary string s and two integers x and y are given. Task is to arrange the given string in such a way so… Read More »

Given a string str, we need to find the no. of positions where a letter(lowercase) can be inserted so that string becomes a palindrome. Examples:… Read More »

Given a string of two characters and n distinct words of two characters. The task is to find if it is possible to arrange given… Read More »

In this article, we will discuss how we can compare to strings lexicographically in Java. One solution is to use Java compareTo() method. The method… Read More »

October 8, 2017

Given a binary string of length N and an integer K, we need to find out how many substrings of this string are exist which… Read More »

October 7, 2017

Given an input string str[], generate two output strings. One of which consists of those character which occurs only once in input string and second… Read More »

October 6, 2017

Given a mathematical equation using numbers/variables and +, -, *, /. Print the equation in reverse. Examples: Input : 20 – 3 + 5 *… Read More »