add solution for populating nextright problem