✅using matrix || cPP
\n# Code\n\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& strs) {\n        int m=strs[0].length();\n        int n=strs.size();\n        if(
\n# Code\n```\nclass Solution {\npublic:\n    int minDeletionSize(vector<string>& strs) {\n        int m=strs[0].length();\n        int n=strs.size();\n        if(n==1)return 0;\n        vector<vector<int>>arr(n,vector<int>(m,INT_MAX));\n        int prec=-1;\n        int ans=0;\n        for(int j=0;j<m;j++){\n            int prev=\'a\'-1;\n            int prer=-1;\n            int flag=1;\n            for(int i=0;i<n;i++){\n                if(prec!=-1 && arr[i][prec]!=0)continue;\n                if(i==0){\n                    arr[i][j]=1;\n                    continue;\n                }\n                if(strs[i-1][j]>strs[i][j]){\n                        flag=0;\n                        break;\n                }\n                else if(strs[i-1][j]==strs[i][j]){\n                    flag=-1;\n                    arr[i][j]=0;\n                }\n                else{\n                    strs[i-1][j]=strs[i][j];\n                    arr[i][j]=1;\n                } \n            }\n            if(flag==0){\n                ans++;\n            }\n            else if(flag==-1){\n                prec=j;\n            }\n            else break;\n        }\n        // for(int i=0;i<n;i++){\n        //     for(int j=0;j<m;j++)cout<<arr[i][j]<<" ";\n        //     cout<<"\\n";\n        // }\n        return ans;\n    }\n};\n```
['Array', 'String', 'Greedy', 'C++']