or at one's wits' end phrasal at a loss for a means of solving a problem
AT ONE'S WIT'S END
Meaning of AT ONE'S WIT'S END in English
Merriam Webster. Explanatory English dictionary Merriam Webster. Толковый словарь английского языка Мерриам-Уэбстер. 2012