Given a binary string S of size N, the task is to find the minimum numbers of 0s that must be removed from the string… Read More

# Category Archives: Strings

Given a string S consisting of N lowercase characters and character ‘?’ and a positive integer K, the task is to replace each character ‘?’… Read More

Given a string S consisting of N digits, the task is to find the number of distinct Prime Numbers that can be formed using the… Read More

DFA or Deterministic Finite Automata is a finite state machine, in which on every input alphabet a transition is done from one state to another… Read More

Given an array arr[] consisting of N strings of lowercase characters and a character K such that any string may start with the character K,… Read More

Given a string str containing characters ‘G’ and ‘F’ only, the task is to check if the given string str can be made empty after… Read More

Given a sorted string S consisting of N lowercase characters, the task is to rearrange characters in the given string such that no two adjacent… Read More

Given two positive integers N and M representing the count of distinct digits and alphabets respectively in a string, the task to count the number… Read More

Given two strings str1 of size N and str2 of size M.The task is to find if it is possible to compose str2 by using… Read More

Given two strings S1 and S2 consisting of N and M lowercase characters, the task is to construct the lexicographically largest string by repeatedly appending… Read More

Given a string S, the task is to count the number of camel case characters present in the given string. The camel case character is… Read More

Given an array arr[] consisting of N strings, the task is to find the maximum sum of length of the strings arr[i] and arr[j] for… Read More

Given encoded string str such that ‘a’ is written 1 time, ‘b’ is written 2 times, and so on, until ‘z’ is written 26 times,… Read More

Given a string S of size N representing a monoalphabetic cipher, the task is to print the top five possible plain texts that can be… Read More

Array Of Strings To sort an array of strings in Java, we can use Arrays.sort() function. // A sample Java program to // sort an… Read More