No description
Find a file
2016-05-24 00:09:54 +10:00
.gitignore Initial commit 2016-03-16 22:40:57 -07:00
LICENSE Initial commit 2016-03-16 22:40:57 -07:00
p01_eneko.swift Create p01_eneko.swift 2016-03-16 22:49:57 -07:00
p01_samjdavis13.swift add solution 1 2016-05-24 00:09:11 +10:00
p02-alt_samjdavis13.swift add solution 2 (alt) 2016-05-24 00:09:54 +10:00
p02_samjdavis13.swift add solution 2 2016-05-24 00:09:23 +10:00
p03_samjdavis13.swift add solution 3 2016-05-24 00:09:32 +10:00
p04_samjdavis13.swift add solution 4 2016-05-24 00:09:42 +10:00
README.md Fix link 2016-03-16 23:18:16 -07:00

Ninety-Nine-Swift-Solutions

Community solutions to the Ninety-Nine Swift Problems (http://enekoalonso.com/projects/99-swift-problems)

Submitting a Solution

To submit your solution please fork this repository and add the files (one per problem) containing your solution. Make sure you name your files in the format pXX_username.swift, where XX is the problem number and username is your GitHub username in lower-case.

Example Solution

Filename: p01_eneko.swift:

extension List {

    /// P01 (*) Find the last element of a linked list.
    /// - returns: T last element of the linked list
    /// - author: Eneko Alonso (eneko.alonso@gmail.com)
    /// - complexity: O(n)
    public var last: T {
        var current = self
        while let next = current.nextItem {
            current = next
        }
        return current.value
    }

}