## Find the longest substring with k unique characters in a given string

Given a string you need to print longest possible substring that has exactly M unique characters. If there are more than one substring of longest… Read More »

- Number of substrings that start with "geeks" and end with "for"
- Count number of substrings of a string consisting of same characters
- Count all substrings having character K
- Lexicographically smallest string of length N and sum K
- Compare two strings considering only alphanumeric characters
- Minimum given operations required to convert a given binary string to all 1's
- Check duplicates in a stream of strings
- Queries for rotation and Kth character of the given string in constant time
- Minimum number of substrings the given string can be splitted into that satisfy the given conditions
- Check if string can be rearranged so that every Odd length Substring is Palindrome
- Print characters having even frequencies in order of occurrence
- Minimum cost to convert str1 to str2 with the given operations
- Reverse the given string in the range [L, R]
- Modulo of a large Binary String
- Check if expression contains redundant bracket or not | Set 2
- Reverse every word of the string except the first and the last character
- Count number of binary strings such that there is no substring of length greater than or equal to 3 with all 1's
- Largest substring of str2 which is a prefix of str1
- Find the character made by adding all the characters of the given string
- Find the occurrence of the given binary pattern in the binary representation of the array elements
- Print characters in decreasing order of frequency
- Longest substring such that no three consecutive characters are same
- Sort groups of numbers and characters separately in a String
- Expand the string according to the given conditions
- Find the number of strings formed using distinct characters of a given string
- Lexicographical ordering using Heap Sort
- Program to Encrypt a String using ! and @
- Concatenate the strings in an order which maximises the occurrence of subsequence "ab"
- Contiguous unique substrings with the given length L
- Minimum number of additons to make the string balanced

Given a string you need to print longest possible substring that has exactly M unique characters. If there are more than one substring of longest… Read More »

Write a function “runCustomerSimulation” that takes following two inputs a) An integer ‘n’: total number of computers in a cafe and a string: b) A… Read More »

First round was Online Test. There were totally 32 Questions divided into 3 categories with no negative marking. 1) Aptitude & Logical Questions (10 Questions)… Read More »

We are given a string having parenthesis like below “( ((X)) (((Y))) )” We need to find the maximum depth of balanced parenthesis, like… Read More »

Given a string of lowercase ASCII characters, find all distinct continuous palindromic sub-strings of it. Examples: Input: str = “abaaa” Output: Below are 5 palindrome… Read More »

Snapdeal conducted placement drive at my campus in January last week for Software Developer. Eligibility- All CSE (no pointer criteria) Online Test- 21 (MCQ) +2… Read More »

Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is… Read More »

Given a string ‘str’, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. Examples:… Read More »

Round1: Online Coding Round There were 4 coding question. Was asked to answer 2 out of 4. 1) Given a list of N coins, their… Read More »

Given a binary string, count number of substrings that start and end with 1. For example, if the input string is “00100101”, then there are… Read More »

Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them. Input: str[]… Read More »

In Manacher’s Algorithm Part 1 and Part 2, we gone through some of the basics, understood LPS length array and how to calculate it efficiently… Read More »

Given a string ‘str’ of digits, find the length of the longest substring of ‘str’, such that the length of the substring is 2k digits… Read More »

In Manacher’s Algorithm – Part 1, we gone through some of the basics and LPS length array. Here we will see how to calculate LPS… Read More »