educative.io

Other DP problems

Hi,

As I am working through the course I am finding DP less intimidating now. However I was wondering in which pattern the below question would fit?

In share trading, a buyer buys shares and sells on a future date. Given the stock price of n days, the trader is allowed to make at most k transactions, where a new transaction can only start after the previous transaction is complete, find out the maximum profit that a share trader could have made.

Any help or pointers are appreciated.
Thanks.