expected output 1

image

output 1 (incorrect)

image

expected output 2

image

output 2 (correcto!)

image