rev_brute_force_generalcase