The task at hand involves manipulating a string S of length N, given as input. The string is subjected to a series of B swaps, each performed according to the following procedure: The character at position i is swapped with the character located C positions ahead of it, or (i + C)%N. This swapping process is repeated B times, with each iteration starting from the next position in the string. In other words, after one swap is performed, the next swap begins with the character immediately following the previous one. The result of the B swaps is the final string, which is the desired output of the program. This problem requires a good understanding of string manipulation and basic concepts of modular arithmetic....
Given a binary array arr[], the task is to find the longest subarray of non-empty cells after the removal of at most 1 empty cell....
Given two arrays firstArr[], consisting of distinct elements only, and secondArr[], the task is to find the length of LCS between these 2 arrays....
Given N number of envelopes, as {W, H} pair, where W as the width and H as the height. One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope. Find the maximum number of envelopes that can be put inside another envelope and so on. Rotation of envelope is not allowed....
In number theory, a weird number is a natural number that is abundant but not semiperfect. In other words, the sum of the proper divisors (divisors including 1 but not itself) of the number is greater than the number, but no subset of those divisors sums to the number itself. Given a number N, the task is to check if the number is weird or not....
There is one meeting room in a firm. There are N meetings in the form of (S[i], F[i]) where S[i] is the start time of meeting i and F[i] is the finish time of meeting i. The task is to find the maximum number of meetings that can be accommodated in the meeting room. Print all meeting numbers...
The Coin Change Problem is considered by many to be essential to understanding the paradigm of programming known as Dynamic Programming. The two often are always paired together because the coin change problem encompass the concepts of dynamic programming. For those who don’t know about dynamic programming it is according to Wikipedia,...
The process consisted of 1 online coding round , 3 tech interview rounds and 1 HR interview round....
Goldman Sachs visited our campus recently for the internship....
We have discussed Prim’s algorithm and its implementation for adjacency matrix representation of graphs. As discussed in the previous post, in Prim’s algorithm, two sets are maintained, one set contains list of vertices already included in MST, other set contains vertices not yet included. In every iteration, we consider the minimum weight edge among the edges that connect the two sets....
Hi everyone. Today I’m going to share Qualcomm interview experience for the role of Software Engineer. I hope it’ll surely help you to prepare well for the next interview. So without further ado let’s get started....