zigzag conversion

a math problem