FortifyIQ Interview Question

There was an abstract algorithmic task with ghost