I understood - there are n boxes having n types of balls; we have to swap them n order to make condition when each type of ball is in respective container. ex - type1 balls in cont1, type2 in cont2 so we have to just check there are equal number of each type with balls present in that container. ex- we want all balls of type1 in cont1, type2 in cont2, so we have to ckeck number of balls present in that container is equal to number of balls present globally for that type.
Your speaking style is so comfortable to hear, i feel my elder brother teach to me. I watch many channel to understand this question but here i satisfy my answer. Thank You☑
Jab koi bhi jagah par arr[row][col] aur arr[row][col+1] ki values same na aaye. suppose ek cell mein likha hai 1 aur adjacent wali pr likha - 1 ya fir vice versa. Tab ball neeche nhi giregi.
I know that you are too busy in life But i like your style of teaching A daily video can help me and many more students. Please try if you can it helps so much I believe that you can grow easily in RU-vid.
The box with least no. of balls will be used for storing the ball type which has the least count and so on (because in swapping we cannot increase or decrease no. of balls in a box)
brother you just write the code and did not explain the only thing you explained was already explained in question itself no approach to the soloution alogorithm please make a descriptive video of how to come to looping and containers and type array and how to find the equality condition in the question