[HackerRank] Designer PDF Viewer

Designer PDF Viewer

Refactoring for this problem was much easier than the previous one. This one went well in terms of TDD, I got it to pass the test (green) and then refactored. The challenge was getting the number for each letter in a given word. How do I know what number a letter is (out of 0-25)? I looked up how to generate a list of strings of the alphabet and how to get an index from that. From that point it was just a matter of matching up letters from the word with the alphabet list.

My goal was for readability, and I think it could use some more work. I think it could be clearer what’s going on.

Link: http://ift.tt/2l56rnF

February 11, 2017 at 09:42AM
via GitHub http://ift.tt/2khCDju

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s