/*  function to remove the number of repeated sequences in binary
 *  before: ACTTGCb0000000001
 *  after:  ACTTGC
 *  note: 98u8 is ASCII for b, 10u8 is for \n
 */
function to remove the number of repeated sequences in binary
before: ACTTGCb0000000001
after:  ACTTGC
note: 98u8 is ASCII for b, 10u8 is for \n
function to remove the number of repeated sequences in binary before : ACTTGCb0000000001 after : ACTTGC note : 98u8 is ASCII for b 10u8 is for \ n
pub fn remove_cpcnt(v: &mut Vec<u8>) -> Vec<usize> {
    let mut cpcnt: Vec<usize> = Vec::new();
    let mut tmp_count: Vec<u8> = Vec::new();
    let mut result: Vec<u8> = Vec::new();
    let mut copy: bool = true;
    let mut i: usize = 1;
    for element in v.clone() {
        if element == 98u8 {
            copy = false;
            i += 1;
            continue;
        } else if element == 10u8 || i == v.len() { 
            if i == v.len() { tmp_count.push(element);}
            let count = isize::from_str_radix(std::str::from_utf8(&tmp_count).unwrap(),2).unwrap();
            cpcnt.push(count as usize);
            tmp_count = Vec::new();
            if element == 10u8 { copy = true; }
        }
        if copy == true { result.push(element); }
        else { if i < v.len() {tmp_count.push(element);} }
        i += 1;
    }
    let mut old_v = mem::replace(v, result);
    old_v.clear();
    cpcnt
}
pub fn remove_cpcnt ( v : & mut Vec < u8 > ) -> Vec < usize > { let mut cpcnt : Vec < usize > = Vec :: new ( ) ; let mut tmp_count : Vec < u8 > = Vec :: new ( ) ; let mut result : Vec < u8 > = Vec :: new ( ) ; let mut copy : bool = true ; let mut i : usize = 1 ; for element in v . clone ( ) { if element == 98u8 { copy = false ; i += 1 ; continue ; } else if element == 10u8 || i == v . len ( ) { if i == v . len ( ) { tmp_count . push ( element ) ; } let count = isize :: from_str_radix ( std :: str :: from_utf8 ( & tmp_count ) . unwrap ( ) , 2 ) . unwrap ( ) ; cpcnt . push ( count as usize ) ; tmp_count = Vec :: new ( ) ; if element == 10u8 { copy = true ; } } if copy == true { result . push ( element ) ; } else { if i < v . len ( ) { tmp_count . push ( element ) ; } } i += 1 ; } let mut old_v = mem :: replace ( v , result ) ; old_v . clear ( ) ; cpcnt }
function to remove the number of repeated sequences in binary
  before: ACTTGCb0000000001
  after:  ACTTGC
  note: 98u8 is ASCII for b, 10u8 is for \n
function to remove the number of repeated sequences in binary before : ACTTGCb0000000001 after : ACTTGC note : 98u8 is ASCII for b 10u8 is for \ n
v
&mut Vec<u8>