Fixed index value in brute force algorithm.
Added brute force tests.