[rack one's brain] {v. phr.}
To try your best to think; make a great mental effort; especially: to try to remember something you have known.
* /Bob racked his brain trying to remember where he left the book./* /Susan racked her brain trying to guess whom the valentine came from./* /John racked his brain during the test trying to solve the problem./