Help | Runtime analysis for PathWithMaxGoldProblem | Leetcode

I have solved Path with Maximum Gold on LeetCode.

My solution can be found here, I couldn’t derive the complexity for this problem.

I am looking for some help to understand how to analyse runtime of this kind of algorithms. Some doc. would be really helpful