jiǎo​nǎo​zhī

to rack one's brains