Is there an idiom/phrase which contains the word "head" to mean "thinking hard to solve a problem"?


I am looking for an idiom or phrase that means "thinking hard by myself to solve a problem". I hope the idiom or phrase has the word "head" in it.


Example: I have been ____ head ______ for the last 5 days to solve this math puzzle.




Comments