D is kind of a simple breadth-first search, so have not covered it, you can check my solution atcoder.jp/contests/abc361/submissions/55280719 and ask me if there is any doubt For C you can think about having a subsequence of N-K elements, so we can sort it and consider every subarray of size n-k. Here is my solution atcoder.jp/contests/abc361/submissions/55269760
nice explanation 👍
Bro can you explain C and D prb too?
D is kind of a simple breadth-first search, so have not covered it, you can check my solution atcoder.jp/contests/abc361/submissions/55280719 and ask me if there is any doubt
For C you can think about having a subsequence of N-K elements, so we can sort it and consider every subarray of size n-k. Here is my solution atcoder.jp/contests/abc361/submissions/55269760