BNY interview question

Advance Java Programs ,check hackerrank