Thursday, January 24, 2019

503 Next great element II - a better solution

Jan. 24, 2019

Introduction


It is the algorithm related to stack. What I did is to spend 30 minutes to run the code from Leetcode discuss, debug the code and learn one new idea.

Optimal solution


It is hard for me to come out the optimal solution in my practice. I did write solution more than one month ago. Today I studied one solution and wrote my own one.

Here is C# code. I like to write a discuss post as well.


No comments:

Post a Comment