increasing and decreasing are two functions . if function return true value then print 0 otherwise 3.
if ( increasing ( $ a , $ n ) == true || decreasing ( $ a , $ n ) == true ) return 0 ; else return 3 ; }