Verint interview question

Jump game leetcode question,OOPS pillars