1.1(2)

question 1.1 without using additional data structure