Answer
The potatoes are sprouting and producing etiolated stems which are trying to use all possible speed to reach the light. The potatoes interpret the dark cupboard as being underground, so they try to grow up towards the light so that they can deetiolate and photosynthesize.
Work Step by Step
Remember that plants do things that make sense if they are in their normal habitat, so try to imagine how the dark cupboard is like normal potato habitat, and reason from there.