Data Analysis questions

No, look how j is calculated. The code works fine, and gets the correct answer with test cases.

That is not my code. The download link is in the code.