Questions related to strings

Frequency Measuring Techniques for Competitive Programming

Measuring the frequency of elements in an array is a really handy skill and is required a lot of competitive coding problems. We, in lot of… Read More »

Web server log which maintains a history of page requests, typically appended to the end of the file. Information about the request, including client IP… Read More »

TCS National Qualifier 2 Coding Question.

You are given a string and your task is to print the frequency of each character character. Direction to Solve Problem 1. Take string from… Read More »

Check if a number is in given base or not

Given a number as string and a base, check if given number is in given base or not. Examples: Input : str = “1010”, base… Read More »

Maximum length subsequence possible of the form R^N K^N

Given a string containing only two characters i.e. R and K (like RRKRRKKKKK). The task is to find the maximum value of N for a… Read More »

Edit Distance | DP using Memoization

Given two strings str1 and str2 and below operations that can be performed on str1. Find the minimum number of edits (operations) required to convert… Read More »

Substring Sort

Given n strings, we need to sort those strings such that every string is a substring of all strings after it. If not possible to… Read More »

Check if max occurring character of one string appears same no. of times in other

Given two strings, we need to take the character which has the maximum occurrence in the first string and then we have to check if… Read More »

Remove all non-alphabetical characters of a String in Java

Given a string str, consisting of non-alphabetical characters. The task is to remove all those non-alphabetical characters of str and print the words on a… Read More »

Longest common anagram subsequence from N strings

Given N strings. Find the longest possible subsequence from each of these N strings such that they are anagram to each other. The task is… Read More »

Find indices of all occurrence of one string in other

Given two strings, str1 and str2, the task is to print the indices(Consider, indices starting from 0) of occurrence of str2 in str1. If no… Read More »

Check if two strings are permutation of each other

Write a function to check whether two given strings are Permutation of each other or not. A Permutation of a string is another string that… Read More »

Remove all occurrences of a character in a string

Given a string. Write a program to remove all the occurrences of a character in the string. Examples: Input : s = “geeksforgeeks” c =… Read More »

Find alphabetical order such that words can be considered sorted

Given an array of words, find any alphabetical order in the English alphabet such that the given words can be considered sorted (increasing), if there… Read More »

Maximum power of jump required to reach the end of string

Given a string consisting of 1 and 0, the task is to find out the maximum power of jump required to reach the end of… Read More »