Candy

constant space implementation.