P&P Optica interview question

Write code to compare to lines