Can You Feed These Hungry Students On LeetCode?

A Peek Into Arrays, Stacks, Queues & Deques

Dr. Ashish Bamania
3 min readMay 4, 2024

--

Generated with DALL-E 3

I recently came across an interesting problem on Leetcode.

It goes like this —

There’s a school cafeteria that offers two kinds of sandwiches (denoted with 0 (circular shaped) and 1 (square shaped).

These sandwiches are put in a Stack.

--

--

Dr. Ashish Bamania

Doctor 🩺 | Self-Taught Software Developer 👨‍💻 | Author 📘 | AIIMS, New Delhi 👨‍🎓 | Subscribe to my newsletter here: https://bytesurgery.substack.com/