text: DFS function to find ideal pairs
code: function dfs ( node ) { Ideal_pair += bit_q ( Math . max ( 1 , node - k ) , Math . min ( n , node + k ) ) ; bit_up ( node , 1 ) ; for ( let i = 0 ; i < al [ node ] . length ; i ++ ) dfs ( al [ node ] [ i ] ) ; bit_up ( node , - 1 ) ; }