Abjayon interview question

Technical Round - Complete on Java