Keyence interview question

Go over a solution in regards to the material.