have the wit to do something
From Longman Dictionary of Contemporary Englishhave the wit to do somethinghave the wit to do somethingformalINTELLIGENT to be clever enough to know the right thing to do Thankfully, Reid had the wit to see what was wrong with the plan. → witExamples from the Corpushave the wit to do something• Thankfully, Reid had the wit to see what was wrong with the plan.