Tried solving perpetual bikes problem