brute force match, pass all testcases