Microsoft | Onsite | Compare stacks
Anonymous User
1465

Given two stacks, return true if their elements are equal or false if they're not.

Constraints:

  1. Recursion should not be used.
  2. Additional data structure should not be used.
  3. Both the stacks should be restored to their original state after the comparison.
Comments (12)