Help me in solving JBR4 problem

My issue

Learning course: Learn Advance Java
Problem Link: CodeChef: Practical coding for everyone