C++ detailed solution, easy to read code.
TLDR, whenever you delete, only check the strings whose ordering could\'ve been affected by the deletion, instead of restarting the whole process.\n\n# Intuitio
TLDR, whenever you delete, only check the strings whose ordering could\'ve been affected by the deletion, instead of restarting the whole process.\n\n# Intuition\nGo through, mark anything pair of character that are not lexicographically sorted for deletion.  Optimistically assume that whenever two strings are sorted correctly we are done, BUT mark down which index made them sorted so they can be reviewed later.  This way, whenever a deletion occurs, we only check the strings that this could possibly affect\n\n# Complexity\n- Time complexity:\nO(MN) where M is string length and N in number of strings\n\n- Space complexity:\nO(N)\n\n# Code\n```\nclass Solution {\n    unordered_set<int> pos_to_delete;\n    unordered_map<int, vector<int>> used_to_break_tie;\n    void\n    findMismatch(vector<string>& strs_, const string& lhs, const string& rhs, int idx, int string_idx) {   \n        for (int j = idx; j < lhs.size(); ++j) {\n            if (lhs[j] > rhs[j]) {\n                pos_to_delete.insert(j);\n                if (used_to_break_tie.find(j) != used_to_break_tie.end()) {\n                    while (!used_to_break_tie[j].empty()) {\n                        int i = used_to_break_tie[j].back();\n                        used_to_break_tie[j].pop_back();\n                        findMismatch(strs_, strs_[i - 1], strs_[i], j + 1, i);\n                    }\n                }\n            } else if (lhs[j] < rhs[j] && \n                       pos_to_delete.find(j) == pos_to_delete.end()) {\n                used_to_break_tie[j].push_back(string_idx);\n                break;\n            }\n        }\n    }\npublic:\n    int minDeletionSize(vector<string>& strs) {\n        for (int i = 1; i < strs.size(); ++i) {\n            findMismatch(strs, strs[i - 1], strs[i], 0, i);\n        }\n        return pos_to_delete.size();\n    }\n};\n```
['C++']