TikTok Interview Question

Some Dynamics Programming question And code gradient descent update