Skip to content

Category Archives: Strings

Difficulty Level: RookieQuestion: Write a program to print N equal parts of a given string. Solution: 1) Get the size of the string using string function strlen() (present… Read More
A permutation, also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with… Read More
Write a recursive function to print reverse of a given string. Program: C++ // C++ program to reverse a string using recursion  #include <bits/stdc++.h> using… Read More
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1? (eg given s1 = ABCD… Read More
Write an efficient C function that takes two strings as arguments and removes the characters from first string which are present in second string (mask… Read More
Algorithm: Let input string be "geeksforgeeks" 1: Construct character count array from the input string. count['e'] = 4 count['g'] = 2 count['k'] = 2 …… 2: Print all the indexes from the constructed array which have value greater than 0.
Given a string S, the task is to remove all the duplicates in the given string. Below are the different methods to remove duplicates in… Read More
  Write an efficient function to return maximum occurring character in the input string e.g., if input string is “test” then function should return ‘t’. … Read More