Sunday, November 19, 2017

Lucky purchase - week of code 35

Nov. 19, 2017

Introduction


It is the first easy algorithm in week of code 35. The problem statement is here.

The code submitted in the contest is here.

A bug 


I spent over one hour to work on the algorithm, my first two submissions could not solve test case 4 and 5. And then I went over problem statement again and again, read aloud one word a time in the problem statement and then had an idea to fix the bug issue.

If the char is not digit, then it should be ok. Only the digit char should be 4 or 7.


No comments:

Post a Comment