Given a string S, the task is to sort odd indices in ascending order and even indices in descending order of the string. Examples: Input: S = "Cplusplus" Output: Cululspsp Explanation: Sort Read more →
Strings
22 postsYou are given a string s consisting only of characters ‘a’ and ‘b’. You can delete any number of characters in s to make s balanced. s is balanced if there is Read more →
Given two strings string1 and string2, the task is to find the smallest substring in string1 containing all characters of string2. Examples : Input: string = “Cplusplus is the best”, pattern = Read more →
Given a string str. The task is to check whether this string can be splitted into two strings X and Y such that Y is a substring of X X + Y Read more →
Given a Binary String S of length N which consists of only 0 and 1, the task is to remove minimum number of 0’s from the string such that all 1’s form Read more →
Given two lowercase alphabet strings s and t return whether you can create a 1-to-1 mapping for each letter in s to another letter (could be the same letter) such that s Read more →
Given a string S containing 0’s and 1’s, the task is to find the length of longest continuous substring of 0’s from the given string. Examples: Input: S = 1111111 Output: 0 Read more →
Given n strings in any order. Sort all the strings (lexicographically), but if a string is present completely as a prefix in another string, then string with larger length should come first. Read more →
Given 2 strings A and B, the task is to count the number of substrings of A which are also present in B. Example: Input: a="plu" b="Cplusplus" Output: 6 Explanation: p, l, Read more →
Given a string A, compute the minimum number of characters you need to delete to make resulting string a palindrome. Examples: Input : baca Output : 1 Input : cplusplus Output : Read more →