Link of the problem :
https://practice.geeksforgeeks.org/contest-problem/bjorn-ironside/1/
In the hints section , they only mentioned the code of solution , which seems to involve digit dynamic programming . Can somebody explain solution to this problem or at least explain what the dp states are ? Thankyou .
Code given by them for this problem : (C++ code written in leetcode contest type format)
Code