Happy Coding

This blog is for my memorandum about programming and English.

Happy Coding

This blog is for my memorandum

stack

Queue via Stacks

problem Implement a MyQueue class which implements a queue using two stacks how to solve I implement two functions pop and push. The first one is getting and removing the oldest element in MyQueue. The second one is adding the element into…

316. Remove Duplicate Letters (Leet Code, Google)

problem Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order among all possible results. Exam…