cudgel your brain
cudgel (one's) brains
To try very hard to comprehend, solve, think of, or remember something. I was up all night cudgeling my brains for a way to pay off all my debts. She cudgeled her brains to remember the man's name.
Farlex Dictionary of Idioms. © 2015 Farlex, Inc, all rights reserved.
cudgel your brain (or brains)think hard about a problem.
This expression was used by Shakespeare in Hamlet: ‘Cudgel thy brains no more about it’.
Farlex Partner Idioms Dictionary © Farlex 2017