Swift Coding Challenges: Challenge 1

less than 1 minute read

As an effort to improve and challenge myself I got a copy of Paul Hudson's Swift Coding Challenges book and I'm going to work through it and post my thoughts on it and about how I did. I (probably) won't post the answers because that might spoil it for some.

For Challenge 1 I basically had the first answer, however I ... um ... made it more complex than I needed to (I'm going to blame it on doing it at 1am). I ended up using a dictionary to store the character and the count of the occurrences of that character, yet I still dropped out of the function if the dictionary keys contained the current character.

I was over thinking the challenge and for some reason thinking about actually counting the occurrences of letters.

facepalm

Leave a comment