<commit_before>package leetcode

/**
 * https://leetcode.com/problems/describe-the-painting/
 */
class Problem1943 {
    fun splitPainting(segments: Array<IntArray>): List<List<Long>> {
        segments.sortWith { a, b ->
            val cmp = a[0].compareTo(b[0])
            if (cmp == 0) {
                a[1].compareTo(b[1])
            } else {
                cmp
            }
        }
        return listOf()
    }
}

fun main() {
    val prob = Problem1943()
//    println(prob.splitPainting(arrayOf(
//        intArrayOf(1,4,5),
//        intArrayOf(4,7,7),
//        intArrayOf(1,7,9)))) // [[1,4,14],[4,7,16]]
//    println(prob.splitPainting(arrayOf(
//        intArrayOf(1,7,9),
//        intArrayOf(6,8,15),
//        intArrayOf(8,10,7)))) // [[1,6,9],[6,7,24],[7,8,15],[8,10,7]]
//    println(prob.splitPainting(arrayOf(
//        intArrayOf(1,4,5),
//        intArrayOf(1,4,7),
//        intArrayOf(4,7,1),
//        intArrayOf(4,7,11)))) // [[1,4,12],[4,7,12]]
    println(prob.splitPainting(arrayOf(
        intArrayOf(1,4,5),
        intArrayOf(4,7,7),
        intArrayOf(1,7,9),
        intArrayOf(2,5,10),
        intArrayOf(3,5,8),
        intArrayOf(1,2,6),
        intArrayOf(3,5,3),
    ))) // [[1,2,20],[2,3,24],[3,4,35],[4,5,37],[5,7,16]]
}<commit_msg>Update problem 1943<commit_after>package leetcode

/**
 * https://leetcode.com/problems/describe-the-painting/
 */
class Problem1943 {
    fun splitPainting(segments: Array<IntArray>): List<List<Long>> {
        segments.sortWith { a, b ->
            val cmp = a[0].compareTo(b[0])
            if (cmp == 0) {
                a[1].compareTo(b[1])
            } else {
                cmp
            }
        }
        return listOf()
    }
}

fun main() {
    val prob = Problem1943()
//    println(prob.splitPainting(arrayOf(
//        intArrayOf(1,4,5),
//        intArrayOf(4,7,7),
//        intArrayOf(1,7,9)))) // [[1,4,14],[4,7,16]]
//    println(prob.splitPainting(arrayOf(
//        intArrayOf(1,7,9),
//        intArrayOf(6,8,15),
//        intArrayOf(8,10,7)))) // [[1,6,9],[6,7,24],[7,8,15],[8,10,7]]
//    println(prob.splitPainting(arrayOf(
//        intArrayOf(1,4,5),
//        intArrayOf(1,4,7),
//        intArrayOf(4,7,1),
//        intArrayOf(4,7,11)))) // [[1,4,12],[4,7,12]]
//    println(prob.splitPainting(arrayOf(
//        intArrayOf(1,4,5),
//        intArrayOf(4,7,7),
//        intArrayOf(1,7,9),
//        intArrayOf(2,5,10),
//        intArrayOf(3,5,8),
//        intArrayOf(1,2,6),
//        intArrayOf(3,5,3),
//    ))) // [[1,2,20],[2,3,24],[3,4,35],[4,5,37],[5,7,16]]
    // [[1,4,5],[4,7,7],[1,7,9],[9,14,1],[10,16,3],[5,9,2],[6,8,4],[20,25,10]]
    println(prob.splitPainting(arrayOf(
        intArrayOf(1,4,5),
        intArrayOf(1,7,9),
        intArrayOf(4,7,7),
        intArrayOf(5,9,2),
        intArrayOf(6,8,4),
        intArrayOf(9,14,1),
        intArrayOf(10,16,3),
        intArrayOf(20,25,10),
    ))) // [[1,4,14],[4,5,16],[5,6,18],[6,7,22],[7,8,6],[8,9,2],[9,10,1],[10,14,4],[14,16,3],[20,25,10]]
}
{'fraction_non_alphanumeric': 0.23961766644693475, 'fraction_numerical': 0.1133816743572841, 'mean_word_length': 2.284632034632035, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6121668', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1266, 'n_words': 119}