So i am trying to solve this problem`` And this is the tutorial i am referring to.Also this is the code. And I am trying to do it by dynamic approach. But can anyone please explain me this part :

` if (dp[i - 1][j] > dp[i][(j * 10 + arr[i]) % 8])`
` dp[i][(j * 10 + arr[i]) % 8] = dp[i - 1][j];`
``
` // If we exclude the number from our combination`
` if (dp[i — 1][j] > dp[i][j])`
` dp[i][j] = dp[i — 1][j];`

what is j * 10 + arr[i]) % 8 doing here?. what is j here?. It will be great if you could explain in details?

Thank you!