Delete Columns to Make Sorted LeetCode solution in C++
1class Solution {2public:3int minDeletionSize(vector<string> &strs) {4int col = strs[0].size();5int row = strs.size();6int count = 0;7for (int c = 0; c < col; c++) {8for (int r = 1; r < row; r++) {9if (strs[r][c] - strs[r - 1][c] < 0) {10count++;11break;12}13}14}15return count;16}17};