what u need is the data structure algorithm, image u store each element into a single room, then rotate the room to left, just like left shift it. Ex: room[0] = 1, room[1] = 2, room[2] = 3, then output it as room[2]room[1]room[0] = 321.
There may be better solutions, i just suggest one of it.
|