ARISTA SDE-1 Offcampus 2021 OA
Anonymous User
1593

1. Given the two array (A,B) Sort them in single array based on the index in 0(N). Hint : use 2 pointer

2. Knapsack problem with {constraint n<=40 and total weight <= 10^9} Hint : DP won't work 

3. Peak and trough in the array , sum all the element which is above given threshold values.

4. You are given a 2d matrix A of m rows and n colums and you have to generate a matrix B of same dimension but the elements must be a summation of all the previous elements upto now.

	For example if A=[{1,2,3},{4,5,6}],
	then B =[{1,3,6},{5,12,21}]
	Explanation: A(0,0)=B(0,0)
	B(0,1)=A(0,0)+A(0,1)
	B(0,2)=A(0,0)+A(0,1)+A(0,2)
	B(1,0)=A(0,0)+A(1,0)
	B(1,1)=A(0,0)+A(0,1)+A(1,0)+A(1,1)
	B(1,2)=A(0,0)+A(0,1)+A(0,2)+A(1,0)+A(1,1)+A(1,2)
Comments (4)