Created
          May 25, 2022 13:25 
        
      - 
      
- 
        Save shapr/d1e7f18e792ea1a4e95aea6ebe122d2e to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | fn solution(s: &str) -> Vec<String> { | |
| let mut pile_of_strings = Vec::new(); | |
| let slice: &[char] = &s.chars().collect::<Vec<_>>()[..]; | |
| for piece in slice.chunks(2) { | |
| if piece.len() > 1 { | |
| pile_of_strings.push(piece.iter().collect()); | |
| } else { | |
| // let squished : &str = &[piece,&['_']].concat(); | |
| pile_of_strings.push(&[piece, &['_']].concat().iter().collect()); | |
| // pile_of_strings.push(&'_'); | |
| } | |
| } | |
| return pile_of_strings; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment