1
use std::collections::HashSet;4
pub fn max_unique_split(s: String) -> i32 {5
let mut combos = HashSet::new();7
let chars: Vec<String> = s.chars().map(|c| c.to_string()).collect();8
Self::helper(&mut combos, &chars, &mut max);13
fn helper(combos: &mut HashSet<String>, chars: &[String], max: &mut usize) {14
if !chars.is_empty() {15
for i in 0..chars.len() {16
let mut substr = chars[0..i + 1]18
.fold(String::with_capacity(i), |mut new_str, s| {22
if !combos.contains(&substr) {23
combos.insert(substr.clone());24
Self::helper(combos, &chars[i + 1..], max);25
combos.remove(&substr);29
if combos.len() > *max {