Questions related to strings

## Splitting a Numeric String

Given a numeric string (length <= 32), split it into two or more integers( if possible), such that 1) Difference between current and previous number… Read More »

## Maximum difference of zeros and ones in binary string | Set 2 (O(n) time)

Given a binary string of 0s and 1s. The task is to find the maximum difference between the number of 0s and number of 1s… Read More »

## Lexicographical concatenation of all substrings of a string

Given a string, find concatenation of all substrings in lexicographic order. Examples: Input : s = “abc” Output : aababcbbcc The substrings of s in… Read More »

## gOOGLE cASE of a given sentence

Given a sentence, task is to rewrite in Google Case. It is a style of writing where we replace all lower case letters into upper… Read More »

## Transform the string

Given a string s, change the string s according to the rules provided below: Delete all the vowels from the string. Insert # in front… Read More »

## First uppercase letter in a string (Iterative and Recursive)

Given a string find its first uppercase letter Examples : Input : geeksforgeeKs Output : K Input : geekS Output : S Recommended: Please try… Read More »

## Count maximum-length palindromes in a String

Given a string, count how many maximum-length palindromes are present.(It need not be a substring) Examples: Input : str = “ababa” Output: 2 Explanation :… Read More »

## Lexicographic rank of a string with duplicate characters

Given a string s that may have duplicate characters. Find out the lexicographic rank of s. s may consist lower as well as upper case… Read More »

## Counting even decimal value substrings in a binary string

Given a binary string of size N. Count all substring that have even decimal value considering binary to decimal conversion from left to right (For… Read More »

## Maximize a number considering permutations with values smaller than limit

Given two numbers N and M. Construct maximal number by permuting (changing order) the digits of N, not exceeding M. Note : It is allowed… Read More »

## Create a new string by alternately combining the characters of two halves of the string in reverse

Given a string s, create a new string such that it contains the characters of the two halves of the string s combined alternately in… Read More »

## Interchanging first and second halves of stings

Given two strings and . Create two new strings by exchanging the first half and second half of one of the strings with the first… Read More »

## Merge two strings in chunks of given size

Given two strings ‘a’ and ‘b’ and a number k, our aim is to merge the strings into a string s such that it contains… Read More »

## Make a lexicographically smallest palindrome with minimal changes

Given a string S. Print the lexicographically smallest string possible. You can make minimal changes to the characters in the string and you can permute… Read More »

## Program for length of a string using recursion

Given a string calculate length of the string using recursion. Examples: Input : str = “abcd” Output :4 Input : str = “GEEKSFORGEEKS” Output :13… Read More »