https://www.geeksforgeeks.org/tug-of-war/