Minimize cost of array swaps

This post was flagged by the community and is temporarily hidden.

What’s the source of the problem (like a link)?

1 Like

It was asked in an interview to me.
Couldnt come up with a require DP solution.

Sorry, but we shouldn’t help you then. It’s very easy to say a problem is from a local competition or interview or something and paste something in from some long challenge (and in fact, someone tried to do that just this week!)

I understand your point but i really dont know how to prove. To my knowledge there is no contest going on right now.

I know, it’s unfair to the people who are legit, but the cheaters ruin it for everyone. Sorry again :frowning:

Im not so good at these problems hence was asking for help. But okay i understand.
If possible please do help.