A method without using additional space