Swift solutions for popular algorithms:
- FizzBuzz algorithm.
Implement algorithm that display numbers from 1 to N.
For any number that is divisible by 3 print out the word Fizz.
For any number that is divisible by 5 print out the word Buzz.
Finally, if number is divisible by both numbers print out FizzBuzz.
- Binary search.
Given array of integers. You have to search through this array and you also have to return true if you found the search value inside this array, otherwise you have to return false.
- Factorials
Implement factorial function
- Most common name in array
Implement algorithm, which find most common name in array
- Reverse every other word
Implement a function that returns this same sentence with every other word reversed.
Source code is distributed under MIT license.