Solution to removing spaces from a string is already posted here. In this article another solution using stringstream is discussed. Algorithm: 1. Enter the whole… Read More

Given an array of integers, replace every element with the least greater element on its right side in the array. If there are no greater… Read More

You are given n days and for each day (di) you could either perform a high effort tasks (hi) or a low effort tasks (li)… Read More

Hi, Recently I got a chance to attend the off campus interview with Amazon (SDE-1).Every code they asked to write on paper and full production… Read More

Maximize arr[j] – arr[i] + arr[l] – arr[k], such that i < j < k < l. Find the maximum value of arr[j] – arr[i]… Read More

Teradata has visited our campus on 18 July 2016. They hired for two profiles: Developer and Test. I was shortlisted for the developer profile. The… Read More

Given a N x N binary matrix (elements in matrix can be either 1 or 0) where each row and column of the matrix is… Read More

Given an array of positive and negative numbers, arrange them such that all negative integers appear before all the positive integers in the array without… Read More

A one-time password (OTP) is a password that is valid for only one login session or transaction, on a computer system or other digital device.… Read More

Written Test MCQs on Coding (predict the output, identify the error, …), Operating System Technical round -1 If a linked list has a cycle OOP… Read More

Some of the merge operation classes are provided in C++ STL under the header file “algorithm”, which facilitates several merge operations in a easy manner.… Read More

Java code: The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements… Read More

Recently, TeraData visited our campus for both developer and test developer profiles. I have been shortlisted for developer profile. Round 1 : Written Test 20… Read More

Given a string of lowercase alphabets, count all possible substrings (not necessarily distinct) that has exactly k distinct characters. Examples: Input: abc, k = 2 Output:… Read More

C++ has a class in its STL algorithms library which allows us easy partition algorithms using certain inbuilt functions. Partition refers to act of dividing… Read More