Check if current element is a fibonacci number
if ( hash . find ( arr [ i ] ) != hash . end ( ) ) { fibcount ++ ; } else fibcount = 0 ; } for ( int i = 0 ; i < n ; i ++ ) res = max ( res , left [ i ] + right [ i ] ) ; return res ; }