Two vector not required (Efficient Solution)


#1

The editorial solution can be made more space efficient. Check this code : https://ideone.com/cskPYW