brute force solution for multiple dismatch problem