Swift solutions to diverse problems. Playground implementation.