Sum of Absolute Differences (SAD)

Here, I am going to discuss an interesting concept which I believe is general concept and can be used in other problems with such requirements. I learnt this while solving codechef problem SUBARRAYGAME

https://www.codechef.com/problems/SUBARRAYGAME

Basic problem: Given an array with distinct integers. Alice and Bob takes turns to remove subarrays from it such that SAD always remains same. What is the optimal strategy to win the game? One who cannot make a move loses.

Idea:

Observation - 1 (Easy to check and prove!)

Observation - 2 (Hard!)

Proof:

Observation - 3(Medium)