MinDeletionSize

  • 2022-12-14
  • 浏览 (539)

MinDeletionSize.java 源码

package algorithm.greedy;

/**
 * @author roseduan
 * @time 2019/8/11 10:18
 * @description 删序造列
 */
public class MinDeletionSize {

    private static int getCount(String[] str){
        int count = 0;

        for (int i = 0; i < str[0].length(); i++) {
            for (int j = 0; j < str.length - 1; j++) {
                if (str[j].charAt(i) > str[j + 1].charAt(i)){
                    count ++;
                    break;
                }
            }
        }
        return count;
    }

}

你可能感兴趣的文章

AssignCookie

BestTimeToBuyAndSellStock

CandyProblem

0  赞