Saturday, October 28, 2017

Women's codesprint 4: Afraid of the Dark

Oct. 28, 2017

Introduction


Now it is 11:19 PM, only 10 hours left for the contest. I only score 19 points, I need to start to work on second medium algorithm called Afraid of the Dark.

It is too late to write code for the algorithm. Now it is 1:51 am. I reviewed the graph algorithm through my coding blog, one popular algorithm is called union find algorithm.

It is not difficult to figure out the solution. We can form the disjoint sets, and then each node belongs to one of set. For set with even number of off light bulbs, the number of visited node is the size of disjoint set. For set with odd number of off light bulbs, each room with off light bulb will have a minimum distance to the leaf node.

Algorithm coding


Plan to write code after the contest.


Actionable Item


It is time for me to review my practice. I felt less engaged to the hackerrank contest, I prefer to read some material on quora.com, but I will be better off to write code and try to push myself to solve algorithm problems.

I do not need to consume so many question/ answers on quora.com. Please limit time to read on quora.com as well.



No comments:

Post a Comment