Closest sum partition ( into two subsets ) of numbers from 1 to n | Function to return the minimum required absolute difference ; Driver code
< ? php function minAbsDiff ( $ n ) { $ mod = $ n % 4 ; if ( $ mod == 0 $ mod == 3 ) return 0 ; return 1 ; } $ n = 5 ; echo minAbsDiff ( $ n ) ; ? >