Some remarks on the harder interview problem

Please find the comment just above the problematic code.