Leetcode approach discuss

In this ,if first convert the string to int using the stoi or atoi then sort the array of vectors and then simply subtract the the sorted one and unsorted one ,take the abs value of the diffence,Now the no o digits in the result got after subtracting is ans.

Is this approach good??or theres a better one and will it satisfy all test cases

about which question you are talking about??

the link you have share is of the question
840. Magic Squares In Grid

So sorry.I shared the wrong link.in my question ,It was an boolean array and it asked us how many bits need to be changed to convert to the sorted boolean array from an unsorted one

can you share the link of problem

I give it when i get it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.