删列造序

 1 class Solution {
 2 public:
 3     int minDeletionSize(vector<string>& A) {    
 4         
 5         if(A.size()==0||A.size()==1)
 6             return 0;
 7         
 8         int res=0;
 9         for(int j=0;j<A[0].size();j++)
10         {
11             for(int i=0;i<A.size()-1;i++)
12             {
13              if(A[i][j]>A[i+1][j])  
14              {
15                  res++;
16                  break;
17              }
18             }
19         }
20         return res;
21     }
22 };

猜你喜欢

转载自www.cnblogs.com/chaoza1/p/10758974.html