Oracle Interview Question

AN algorithm will be asked. difficulty level average