← Deutsche Bank questions

Maximum elements popped from two stacks with sum constraint

Filed under Deutsche Bank

Given two stacks containing positive integers and a target sum N, find the maximum number of elements you can pop from both stacks combined such that the sum of the popped elements does not exceed N.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Deutsche Bank questions

Collected from public candidate posts and coding forums. Updated Nov 2026.