appending takes 1 step , and we directly reach index i * 2 + 1 after appending so the number of steps is stord in i * 2 + 1
if ( $ s1 == $ s2 ) $ dp [ $ i * 2 + 1 ] = min ( $ dp [ $ i ] + 1 , $ dp [ $ i * 2 + 1 ] ) ; } return $ dp [ $ n - 1 ] ; }