This repository contains solutions to Protohackers challenges. The solutions are written in Swift using Swift NIO and Swift Collections (for SortedSet
).
It currently contains solutions to all 11 problems:
- Smoke Test
- Prime Time
- Means to an End
- Budget Chat
- Unusual Database Program
- Mob in the Middle
- Speed Daemon
- Line Reversal
- Insecure Sockets Layer
- Job Center
- Voracious Code Storage
- Pest Control
Each solution is in it's own Swift file like Sources/SwiftProtohackers/00-SmokeTest.swift
for the first problem.
To start the server, run the following command in main directory:
swift run
This will bind to 0.0.0.0
at port 9999
and run the server serving the solution to the most recent problem solved (right now, that would be "10. Voracious Code Storage"). To serve older solutions you'd have to checkout an earlier commit. The repo is organized with 1 flattened commit per problem solved.