text: The function returns true if there exist three elements in AP Assumption : set [ 0. . n - 1 ] is sorted . The code strictly implements the algorithm provided in the reference .
code: bool arithmeticThree ( int set [ ] , int n ) {