<commit_before># Rust solution via @jrick

use std::cmp;
use std::num::{Int, NumCast};

fn percents<T: Int>(input: &Vec<T>) -> Vec<f64> {
    let mul = f64::from(input.iter().fold(T::zero(), |m, &e| cmp::max(m, e))).unwrap();
    input.iter().map(|elem| mul * f64::from(*elem).unwrap()).collect()
}

fn main() {
    let input = vec![99334, 1, 2, 3, 4, 5, 6, 7, 8, 9, 99991];
    let out = percents(&input);
    println!("{:?}", out);
}<commit_msg>Print minimum value as 0%<commit_after>// Rust solution via @jrick

use std::cmp;
use std::num::{Int, NumCast};

fn percents<T: Int>(input: &Vec<T>) -> Vec<f64> {
    let (min, max) = input.iter().fold((T::max_value(), T::min_value()),
        |m, &e| (cmp::min(m.0, e), cmp::max(m.1, e))
    );
    let diff = f64::from(max - min).unwrap();
    input.iter().map(|elem| f64::from(*elem - min).unwrap() / diff).collect()
}

fn main() {
    let input = vec![99334, 100, 200, 300, 99991];
    let out = percents(&input);
    println!("{:?}", out);
}
{'fraction_non_alphanumeric': 0.25176233635448136, 'fraction_numerical': 0.05337361530715005, 'mean_word_length': 3.896551724137931, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '3704452', 'n_tokens_mistral': 440, 'n_tokens_neox': 398, 'n_words': 97}