Check pivot after removing one element | Google Interview Question