Reverse between equal-value nodes in list | Meta Interview Question