Amazon interview question

Fix the code segment, write program segments