Skip to content

Commit

Permalink
Time: 45 ms (86.13%), Space: 12.2 MB (30.23%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipendra-Raghav committed Jan 3, 2023
1 parent 4f9e9bf commit 489d3c2
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class Solution {
public:
int minDeletionSize(vector<string>& strs) {
int ans=0;
int chk=0;
if(strs.size()==1)return 0;
for(int i=0;i<strs[0].size();i++)
{
for(int j=1;j<strs.size();j++)
{
chk=strs[j][i]-strs[j-1][i];
if(chk<0)
{
ans++;
break;
}

}
}
return ans;

}
};

0 comments on commit 489d3c2

Please sign in to comment.