ご質問ありがとうございます。
'solve' の他には、'work out' を使って「〜を解く」と表現することができます。
"It took two hours to work out this math problem."
「この数学の問題を解決するのに2時間かかった。」
ご参考になれば幸いです。
It took two hours to figure out this math problem.
I spent almost two hours trying to get to the bottom of this math problem.
この場合、次のような言い方ができますよ。
ーIt took two hours to figure out this math problem.
「この数学の問題を解決するのに2時間かかった」
to figure out「解明する・問題の解決法がわかる」
ーI spent almost two hours trying to get to the bottom of this math problem.
「この数学の問題を解くのにほとんど2時間かかった」
to get to the bottom of ...「問題を突き止める・解明する」
ご参考まで!