Add brute-force implementation and unit tests