# Tag Archives: interview-preparation

## Longest Substring of 1’s after removing one character

Given a binary string S of length N, the task is to find the longest substring consisting of ‘1’s only present in the string after… Read More »

## Split squares of first N natural numbers into two sets with minimum absolute difference of their sums

Given an integer N, the task is to partition the squares of first N( always a multiple of 8 ) natural numbers into two sets… Read More »

## Minimum number of rabbits that must be present in the forest

There are some colored rabbits in a forest. Given an array arr[] of size N, such that arr[i] denotes the number of rabbits having same… Read More »

## Count ways to make sum of odd and even indexed elements equal by removing an array element

Given an array, arr[] of size N, the task is to find the count of array indices such that removing an element from these indices… Read More »

## Longest subsequence having maximum sum

Given an array arr[] of size N, the task is to find the longest non-empty subsequence from the given array whose sum is maximum. Examples:… Read More »

## Print all strings from given array that can be typed using keys from a single row of a QWERTY keyboard

Given an array of strings arr[], consisting of strings made up of lowercase and uppercase letters, the task is to print all the strings from… Read More »

## Super ASCII String Checker | TCS CodeVita

In the Byteland country, a string S is said to super ASCII string if and only if the count of each character in the string… Read More »

## Probability of collision between two trucks

Given two strings S and T, where S represents the first lane in which vehicles move from left to right and T represents the second… Read More »

## Generate Bitonic Sequence of length N from integers in a given range

Given integers N, L and R, the task is to generate a Bitonic Sequence of length N from the integers in the range [L, R]… Read More »

## TCS Codevita | Holes And Balls

Given two arrays of H[] and B[] consisting of N and M integers respectively, denoting the diameter of holes and balls respectively. M number of… Read More »

## Smallest string which not a subsequence of the given string

Given a string str, consisting of lowercase alphabets, the task is to find the shortest string which is not a subsequence of the given string.… Read More »

## Maximum K-digit number possible from subsequences of two given arrays

Given two arrays arr1[] and arr2[] of length M and N consisting of digits [0, 9] representing two numbers and an integer K(K ≤ M… Read More »

## Minimum number of Appends of X or Y characters from the end to the front required to obtain given string

Given a string S and two positive integers X and Y, the task is to find the minimum number of operations required to obtain the… Read More »

## Minimum index to split array into subarrays with co-prime products

Given an array arr[] consisting of N integers, the task is to find the maximum index K such that the product of subarrays {arr, arr[K]}… Read More »

## Count of substrings having the most frequent character in the string as first character

Given a string S consisting of lowercase alphabets of size N, the task is to count all substrings which contains the most frequent character in… Read More »