This repository contains playgrounds with implementaions for common swift problems, code puzzles and other algorithms.
The focus is on clarity and simplicity of code. That said, most of the code should be ready for your project. Or use the code to prepare for you programming interview or computer science studies.
Swift Algorithms is an open-source package of sequence and collection algorithms, along with their related types. It's pretty new and development is ongoing.
This is a swift knowledge base for common ios problems that occure during daily developer work. The knowledge base is grouped into categories and provides playgrounds for the listed problems.
- How to calculate the ROT13 of a string
- How to capitalize the first letter of a string
- How to capitalize words in a string using capitalized
- How to check whether a string contains any words from an array
- How to concatenate strings to make one joined string
- How to convert a string to lowercase letters
- How to detect a URL in a String
- How to get the lines in a string as an array
- How to load a string from a file
- How to read a single character from a string
- How to remove a prefix from a string
- How to reverse a string using reversed()
- How to run a case-insensitive search for one string inside another
- How to trim whitespace in a string
- How to match regular expressions in strings
- How to add a custom initializer to a struct without losing its memberwise initializer
- How to check for valid method input using the guard keyword
Swift Code puzzles is a collection of interesting problems (also known as challenges) that will help Swift you to learn and practice your skills in logic programming, data structures and algorithms in the Swift programming language.
- All N-Tuples: Generate all N-Tuples
- Longest Palindrom Substring: Two simple solutions to a simple but interesting problem.
- Palindromr: Check if a given string is a palindrome.
- Longest Palindrom Substring: Looks for longest palincromic stubstring.
- Palindrome Number: Determine whether an integer is a palindrome.
- Plus One: Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.
- Sum: Given an array of integers, return indices of the two numbers such that they add up to a specific target.
- WordLadder: Given two words (beginWord and endWord), and a word list, find the length of shortest transformation sequence from beginWord to endWord.
- Roman Numbers: Given a integer convert to roman repreentation and vice versa.
- Missing Ranges: Given a sorted integer array return its missing ranges.
- Sudoku: Check if given Sudoku is valid and find a solution.
- MaxSubArraySumProblem: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
- MaySubArrayProductProblem Smarter Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product.
- Alphabet Cipher: Implement an Alphabet Cipher in Swift.
- AsyncSequence: An AsyncCounter implemented with AsyncSequnces
- DiningPhilosophers: Dining Philosophers implemented with async/wait/Actor pattern
- Big-O notation If you don't understand what does O(n) mean you should read this first.
- Recursion Recursion is one of the central ideas of computer science. Many problems have simple recursive solutions.
- Binary Tree and Binary Search Tree: A tree where each node has at most two children.