<commit_before>package ii_collections

fun example4() {
    val max = listOf(1, 42, 4).max()
    val longestString = listOf("a", "b").maxBy { it.length }
}

fun Shop.getCustomerWithMaximumNumberOfOrders(): Customer? {
    // Return a customer whose order count is the highest among all customers
    todoCollectionTask()
}

fun Customer.getMostExpensiveOrderedProduct(): Product? {
    // Return the most expensive product which has been ordered
    todoCollectionTask()
}<commit_msg>поиск наименьшего и наибольшего значения в коллекции<commit_after>package ii_collections

import ii_collections.data.customers

fun example4() {
    val max = listOf(1, 42, 4).max()
    val longestString = listOf("a", "b").maxBy { it.length }
}

fun Shop.getCustomerWithMaximumNumberOfOrders(): Customer? {
    return customers.maxBy { it.orders.size }
    // todoCollectionTask()
}

fun Customer.getMostExpensiveOrderedProduct(): Product? {
    // Return the most expensive product which has been ordered
   // todoCollectionTask()
    return orders.flatMap { it.products}.toSet().maxBy { it.price }
}
{'fraction_non_alphanumeric': 0.10865561694290976, 'fraction_numerical': 0.009208103130755065, 'mean_word_length': 4.276699029126213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6591433', 'n_tokens_mistral': 334, 'n_tokens_neox': 329, 'n_words': 89}