pit your wits against somebody
From Longman Dictionary of Contemporary Englishpit your wits against somebodypit your wits against somebodyto compete against someone in a test of knowledge or intelligence → witExamples from the Corpuspit your wits against somebody• Jill and Oz will pit their wits against each other, as they try to identify mystery wines.