fn largest(list: &[i32]) -> &i32 {
    let mut largest = &list[0];

    for num in list {
        if num > largest {
            largest = num;
        }
    }

    largest
}

fn main() {
    let number_list = vec![30, 52, 12, 69, 23, 50];
    let large = largest(&number_list);
    println!("Largest: {large}");

    let number_list = vec![130, 52, 12, 69, 23, 50];
    let large = largest(&number_list);
    println!("Largest: {large}");
}
