Finding the minimum sub array sum with at most k swaps from hackerearth.

Hello Sir , how can we do this using heap? any help?