Oracle interview question

Basic computer programming question and asked to solve hackerrank problem