parallelize both brute functions if size > 10000