added k_maxs_v2 using table without sorting the array, need extra space with time complexity O(n)