DarkVision Interview Question

how to improve a algorithm in a cpp coding