Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,006 views
in Online Assessments by Expert (44,360 points) | 1,006 views

2 Answers

0 like 0 dislike
Best answer

Images of ques

image

by Expert (44,360 points)
0 like 0 dislike
Q2: Count mismatches of lunchboxes and students. Intuition: the queue can be cycled until front of queue matches top of stack; even if we get rid of one lunchbox at a time, the queue will eventually deplete until the remaining lunchboxes in stack don't match any student's preference.
by Expert (44,360 points)