100 Days of Code Day 46
Today I just did some exercism exercises. I didn’t have much time or energy so that is all you got. I at least did several this time.
High Scores: Lots of fussing but not hard. Keep track of high scores in an array without messing up the score order.
Isogram: Check if a word has every letter unique. (‘A’ == ‘a’, but space and dash (-) don’t count). Used the higher order function every and it looks pretty nice. Community solution of changing to a set and checking the lengths are equal was much more elegant.
Matching Brackets: Check if the brackets/parenthesis/braces in a given string are balance correctly. Push onto stack when you see (, {, or [. Then when you see ), }, or ] pop off the stack and make sure the pairs match. I like my implementation better.
Phone number: Validate if a given phone number is acceptable and format it in a known format. I wouldn’t have chosen most of those error messages (not in the problem specification of course). Didn’t see much use for a regex for this one, maybe I should have used some.
I was about to stop on Matching Brackets but saw I was just one off from being 50% through so I did one more with Phone Number and got the Laudable Learner trophy.
