MinDeletionSize

2022-12-14 浏览 (889)

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

  • 所属分类: 后端技术
  • 本文标签: 技术
  • 版权声明: 本文链接 https://seaxiang.com/blog/52b96204f7674cfda894a0052d023e2e