the sample input does not follow the format mentioned earlier, could you tell the right input format ?
https://ide.codingblocks.com/s/193158 â this is my code , it has been accepted on leetcode https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/submissions/ , but it is not getting accepted here , please help
Problem in problem statement?
@debyian sorry the explanation of format is little wrong. Correct format is:
t
k
n
a[0] a[1]âĶa[n-1]
k
n
âĶ
so on.
We have t , then in next line k, then in next line n, then in next line n space seprated value.
Then again k, n and so on. If this solves your doubt mark it as resolved.
@debyian I show your code, you are not taking input for k, and are passing n for the value of k. Correct it take values of both n and k, and pass them appropriately your code will work.