text: Closest sum partition ( into two subsets ) of numbers from 1 to n | C ++ implementation of the approach ; Function to return the minimum required absolute difference ; Driver code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; int minAbsDiff ( int n ) { int mod = n % 4 ; if ( mod == 0 mod == 3 ) return 0 ; return 1 ; } int main ( ) { int n = 5 ; cout << minAbsDiff ( n ) ; return 0 ; }