brutal force algorithm