C++ best explained by comments
\n// in this  i have iterated for every column and  then for every string \n// i have used array arr[101] in order to store wich indices are valid and which are
```\n// in this  i have iterated for every column and  then for every string \n// i have used array arr[101] in order to store wich indices are valid and which are not \n// i have taken an array of positions(vector)    done[101] to find at which previous  locations i found this particular (jth index string ) to be smaller than its successor  \n\n\n\nclass Solution {\npublic:\n     int arr[101]={0}; // arr is to check which columns are valid(0) and invalid(-1)\n    vector<int> done[101]; // where u found string j was greater than string j+1 ,u put it into vector\n  \n // below is a helper function in order to check  all the locations (at which string  j has been classified as done   ) are still present or not \n    bool check(vector<int>& a){\n      for(int i:a){\n          if(arr[i]!=-1){\n              return 1;\n          }\n      }\n        return 0;\n    }\nint minDeletionSize(vector<string>& strs) {\n      \n        int ans=0;\n// for iterating columns \n     for(int i=0;i<strs[0].size();i++){\n   // for iterating the strings \n         for(int j=0;j<strs.size()-1;j++){\n        \n           if((done[j].size()==0 || check(done[j])==0) && strs[j][i]>strs[j+1][i]){\n          \n                ans++;\n               arr[i]=-1; // make the column invalid \n                break;\n            } \n             if(strs[j][i]<strs[j+1][i]){\n                 \n                 done[j].push_back(i); // here we are storing at which index (i) said string j is ok \n             }\n         }\n         \n     }\n        \n        return ans;\n    }\n \n};\n```
['C']