Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day 365 #720

Closed
vaskoz opened this issue Aug 22, 2019 · 1 comment · Fixed by #722
Closed

Day 365 #720

vaskoz opened this issue Aug 22, 2019 · 1 comment · Fixed by #722
Assignees

Comments

@vaskoz
Copy link
Owner

vaskoz commented Aug 22, 2019

Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

A quack is a data structure combining properties of both stacks and queues. It can be viewed as a list of elements written left to right such that three operations are possible:

  • push(x): add a new item x to the left end of the list
  • pop(): remove and return the item on the left end of the list
  • pull(): remove the item on the right end of the list.
    Implement a quack using three stacks and O(1) additional memory, so that the amortized time for any push, pop, or pull operation is O(1).
@vaskoz vaskoz self-assigned this Aug 22, 2019
@vaskoz
Copy link
Owner Author

vaskoz commented Aug 24, 2019

NOTE: The solution provided by dailycodingproblem.com for the last day problem has a small bug in it. My solution doesn't contain that typo/bug.

@vaskoz vaskoz mentioned this issue Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant