Leetcode 944. Delete Columns to Make Sorted - Python | Leetcode Daily Challenge

Опубликовано: 09 Октябрь 2024
на канале: Lit Code
80
0

Leetcode Daily Challenge
Leetcode 944. Delete Columns to Make Sorted - Python Solution

You are given an array of n strings strs, all of the same length.

The strings can be arranged such that there is one on each line, making a grid. For example, strs = ["abc", "bce", "cae"] can be arranged as:

abc
bce
cae
You want to delete the columns that are not sorted lexicographically. In the above example (0-indexed), columns 0 ('a', 'b', 'c') and 2 ('c', 'e', 'e') are sorted while column 1 ('b', 'c', 'a') is not, so you would delete column 1.

Return the number of columns that you will delete.

Support the channel by subscribing and hitting the like button.

Solution URL: https://leetcode.com/problems/delete-...

Litcode Playlist: https://bit.ly/3uGBSHx

LinkedIn:   / sachin-singh-ss31  
Email: [email protected]

Animated Character by   / cdyusikuzzo  


#leetcode #leetcodesolution #leetcodedailychallenge #codingpractice #learnpython #python #googleinterview #amazoninterviewpreparation