tarasis.net/_posts/2020-04-20-swift-coding-cha...

17 lines
973 B
Markdown

---
title: 'Swift Coding Challenges: Challenge 1'
tags:
- programming
- ios
- swift
- coding-challenges
category: coding-challenges
date: 2020-04-20 13:36 +0100
---
As an effort to improve and challenge myself I got a copy of Paul Hudson's [Swift Coding Challenges](https://www.hackingwithswift.com/store/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*