Sunday, September 9, 2018

902. Numbers At Most N Given Digit Set

Sept. 9, 2018

Introduction


It is the hard level algorithm. I spent over one hour to work on it in the contest, I came out the idea to work on the solution, but most of my time was to fix bugs related to the test cases.

I like to review the code I wrote and then find out the problems I had through those C# code.


My submissions in the contest


I like to document the submissions I had in the contest.

Here is the picture:


I definitely learned the algorithm and figured out the solution by those failed test cases. I did not take time to document those test cases now.

My C# code review


I like to document my C# code here. I like to review and make some comment for practice after the contest.

My code written 6:30 PM - 8:30 PM

Here is the code I wrote and updated after the contest.

Some advice:

1. Do not write lessThan or lessEqual function. Try to use SortedSet class and use getInBetween API etc.
2. Do not need to write my own API.
3. Try to think and write using existing API, specially in the contest.





No comments:

Post a Comment