fn main(){}

use std::{slice::Iter, cmp::{max, self}, mem::replace, collections::{HashSet, HashMap}, ops::Index, ascii::AsciiExt};
use rand::Rng;
use regex::Regex;
use md5;
use std::any::{Any, TypeId};

/*

    You'll be given a string of words, and your task is to count the number
    of boredoms. A boredom is a sentence that starts with the word "I".
    Sentences are delimited by '.', '?' or '!'.
    
*/
fn is_bored(s:&str) -> i32 {


    let mut count = 0;
    let regex = Regex::new(r"[.?!]\s*").expect("Invalid regex");
    let sqn: Vec<&str> = regex.split(s).into_iter().collect();
    for s in sqn {
        if s.starts_with("I ") {
            count += 1;
        }
    }
    return count;
}
