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
19 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 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 →
The string.h header defines one variable type, one macro, and various functions for manipulating arrays of characters. Functions provided by string.h The string.h header file declares a set of functions to work Read more →
In this article, you’ll learn about strings in C programming. Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated Read more →