Print the first non-repeated character from a string in Swift
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
Swift
🤖 Code Explanation
This code finds the first non-repeated character in a given string. It does this by creating a dictionary of characters and their counts. It then loops through the string again and returns the first character with a count of 1.
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
More problems solved in Swift
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968371.png)