Hi,
yes, that's a good process that you kept trying, never give up on such problem, try to find a way, no matter how complex, weird, hacky, and then compare with other's solution, that's the best way to learn and also develop the much needed "duck and tape" coding attitude and learn many tricks along the way.
Bye,
Jean