I am a big fan of Apple Swift programming language. Here are some works I have done with it so far. Hope you can find them some how useful to you. Please do leave comments
LeetCode in Swift
1: each links to a blog post of mine that is dedicated to the problem
2: total execution time of a solution on my MacBook Pro (Late 2013, 2.6 GHz Intel Core i7, 16 GB 1600 MHz DDR3). Each solution is compiled with following command:
$ swiftc -O -sdk `xcrun --show-sdk-path --sdk macosx` json.swift main.swift -o mySolution
The total execution time is the average of 10 runs.
3: these test cases are semi-automatically :P retrieved from LeetCode Online Judge system and are kept in JSON format
4: each Xcode project includes everything (my Swift solution to a problem, its JSON test cases and a driver code to test the solution on those test cases)
Problem1 | Time2 | Test Cases3 | My Xcode Project4 |
Longest Palindromic Substring | 2.413ms | ||
Largest Rectangle in Histogram | 6.869ms | ||
Word Search | 57.457ms | ||
Reverse Words in a String | 268.937ms | ||
Binary Tree Level Order Traversal II | 5.797ms | ||
Binary Tree Level Order Traversal | 5.631ms | ||
Binary Tree Preorder Traversal | 1.339ms | ||
Binary Tree Inorder Traversal | 1.594ms | ||
Binary Tree Postorder Traversal | 1.694ms | ||
Search Insert Position | 0.002ms | ||
Insertion Sort List | 26.869ms | ||
Sort List | 32.593ms | ||
Max Points on a Line | 3.648ms | ||
Evaluate Reverse Polish Notation | 107.186ms |