pub fn encode(inp_string: &'static str) -> String{
    let x = tokenize(inp_string);
    let x_tuple = tupleize(x);
    let x_converted = tup_convert(x_tuple);
    let mut encoded_string: String = "".to_string();
    for each in x_converted.into_iter() {
        encoded_string.push_str(each.as_str());
    }
    return encoded_string;
}

// Tokenizes a to-be-encoded string
fn tokenize(inp_string: &'static str) -> Vec<String>{

    
    vec![String::from("AAA"), String::from("BB"), String::from("C"), String::from("DDDD")]
}

// "Tuple-izes" a to-be-encoded vector
fn tupleize(inp_vec: Vec<String>) -> Vec<(char, usize)>{
    let mut tupleized: Vec<(char, usize)> = Vec::new();
    for each in inp_vec {
        tupleized.push((each.chars().next().unwrap(), each.len()));
    }
    return tupleized;
}

// Converts tuple into a vector of strings
fn tup_convert(inp_tuple: Vec<(char, usize)>) -> Vec<String>{
    let mut converted: Vec<String> = Vec::new();
    for i in 0..inp_tuple.len() {
        let converted_element: &str = &(inp_tuple[i].1.to_string().as_str().to_owned() + inp_tuple[i].0.to_string().as_str());
        // let converted_element: &'static str = string_converted_element;
        converted.push(converted_element.to_owned());
    }
    return converted;
}

pub fn decode(inp_string: &'static str) -> String{
    return String::from("")
}

fn main(){
    print!("{}", encode("AAABBCDDDD"));
}