Function to find the length of a longest subarray in which elements greater than K are more than elements not greater than K
function LongestSubarray ( a , n , k ) { var pre = Array . from ( { length : n } , ( _ , i ) => 0 ) ;