## Swap all occurrences of two characters to get lexicographically smallest string

Given a string str of lower case English alphabets. One can choose any two characters in the string and replace all the occurrences of the… Read More »

- Count common characters in two strings
- Repeated Character Whose First Appearance is Leftmost
- Convert character array to string in C++
- Count substrings that contain all vowels | SET 2
- Find the longest string that can be made up of other strings from the array
- Minimum number of times A has to be repeated such that B is a substring of it
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Check for balanced parentheses in an expression | O(1) space | O(N^2) time complexity
- Check whether two strings contain same characters in same order
- Rearrange characters in a string such that no two adjacent are same using hashing
- Generate all permutations of a string that follow given constraints
- Program to find the kth character after decrypting a string
- Check if two strings are same ignoring their cases
- Java program to check whether a string is a Palindrome
- Minimum number of adjacent swaps to convert a string into its given anagram
- Maximize the happiness of the groups on the Trip
- Distinct palindromic sub-strings of the given string using Dynamic Programming
- Program to generate all possible valid IP addresses from given string | Set 2
- Find the number of binary strings of length N with at least 3 consecutive 1s
- InfyTQ 2019 : Find the position from where the parenthesis is not balanced
- Minimum rotations required to get the same String | Set-2
- Implement a Dictionary using Trie
- Check if a string can be obtained by rotating another string d places
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Append a digit in the end to make the number equal to the length of the remaining string
- Count of substrings which contains a given character K times
- C++ program to compare two Strings using Operator Overloading
- Minimum number of sub-strings of a string such that all are power of 5
- Reverse individual words with O(1) extra space
- Persistent Trie | Set 1 (Introduction)

Given a string str of lower case English alphabets. One can choose any two characters in the string and replace all the occurrences of the… Read More »

Given a string array arr[], the task is to find the longest sub-sequence of the array with at least one character appearing in all the… Read More »

Given a balanced parenthesis string which consists of ‘(‘ and ‘)‘. The task is to find the number of balanced parenthesis substrings in the given… Read More »

Given a string str in which an integer is appended in the end (with or without leading zeroes). The task is to find a single… Read More »

Given binary string S of size N and a number K. The task is to find the Longest sub string of 0’s in the string… Read More »

Given a string S of length N and an integer P(1≤P≤N) denoting the position of a character in the string. The task is to find… Read More »

Given two string s1 and s2, the task is to check if characters of the first string can be mapped with the character of the… Read More »

Implement a dictionary using Trie such that if the input is a string representing a word, the program prints its meaning from the prebuilt dictionary.… Read More »

Given a string str consisting of uppercase and lowercase characters. The task is to sort uppercase and lowercase characters separately such that if the ith… Read More »

Given two strings str1 and str2 of lengths M and N respectively. The task is to find all the distinct string of length M +… Read More »

Given an array arr[] of strings, the task is to print the strings from the array which are not prefix of any other string from… Read More »

Given two strings str1 and str2 each of length N, the task is to generate and print all possible strings of length N such that… Read More »

Given a string str and a character ch, the task is to find the longest palindromic sub-string of str such that it starts and ends… Read More »

Given two strings str1 and str2 and an integer d, the task is to check whether str2 can be obtained by rotating str1 by d… Read More »

Given a string containing only digits, restore it by returning all possible valid IP address combinations. A valid IP address must be in the form… Read More »