You want to maximize the profit from a trading portfolio while taking a minimum number of losses.
Given:
The traders can:
Find the maximum total profit that can be earned after taking at least K losses. Return -1 if it is not possible to take k losses.