The LEDs are arranged in two branches such that one branch conducts current when the input voltage is positive and the other branch conducts when the input is negative. The value of the current limiting resistor is such that the current is enough for the LEDs to light up.