Some algorithms and problems with Swift and Playground