Rectangular chocolate bar Create at least one piece which consists of exactly nTiles tiles.
You have a rectangular chocolate bar that consists of width x height square tiles. You can split it into two rectangular … Read More
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
You have a rectangular chocolate bar that consists of width x height square tiles. You can split it into two rectangular … Read More
by Dhaval Dave
by Dhaval Dave
Given two sequences, print the longest subsequence present in both of them.
Examples:
LCS for input Sequences “ABCDGH” and “AEDFHR” is “ADH” of length 3.
LCS for input Sequences “AGGTAB” and
by Dhaval Dave
With two different solutions.
Eg : Input : teeterson Output : r,
by Dhaval Dave
by Dhaval Dave
Method 1 (Brute Force Method)
We can consider all substrings.
One by one and check for each substring whether it contains all unique characters or not.
There
by Dhaval Dave
Input: In-order traversal in[] = {4, 2, 5, 1, 3, 6} Pre-order traversal pre[] = {1, 2, 4, 5, 3,
by Dhaval Dave
1) Keep a Min & Max Heap of K size 2) Store first K elements
by Dhaval Dave
by Dhaval Dave
Loop Node5 Next pointer is point to Node3 in Singly Linked List 1 ---- 2 ---- 3 ---- 4 ---- 5 |_____________|