Welcome To Tutorialspoint.dev
Officially launched 18th May 2019

Find if an array of strings can be chained to form a circle Set 2

Given an array of strings, find if the given strings can be chained to form a circle. A string X can be put before another string Y in circle if the last character o...

Find if an array of strings can be chained to form a circle Set 1

Given an array of strings, find if the given strings can be chained to form a circle. A string X can be put before another string Y in circle if the last character o...

Return maximum occurring character in an input string

Write an efficient function to return maximum occurring character in the input string e.g., if input string is &#x201C;test&#x201D; then function should return &#x20...

Group Shifted String

Given an array of strings (all lowercase letters), the task is to group them in such a way that all strings in a group are shifted versions of each other. Two string ...

Count Substrings with equal number of 0s, 1s and 2s

Given a string which consists of only 0s, 1s or 2s, count the number of substrings that have equal number of 0s, 1s and 2s. Examples: Input : str = &#x201C;0102010&...

Palindrome Substring Queries

Given a string and several queries on the substrings of the given input string to check whether the substring is a palindrome or not. Examples : Suppose our input st...

Rearrange characters in a string such that no two adjacent are same

Given a string with repeated characters, task is rearrange characters in a string so that no two adjacent characters are same. Note : It may be assumed that the strin...

Minimum sum of squares of character counts in a given string after removing k characters

Given a string of lowercase alphabets and a number k, the task is to print the minimum value of the string after removal of &#x2018;k&#x2019; characters. The value o...

Find maximum depth of nested parenthesis in a string

We are given a string having parenthesis like below &#xA0;&#xA0;&#xA0;&#xA0; &#x201C;( ((X)) (((Y))) )&#x201D; We need to find the maximum depth of balanced parenthe...

Length of the longest valid substring

Given a string consisting of opening and closing parenthesis, find length of the longest valid parenthesis substring. Examples: Input : ((() Output : 2 Explanation : ...