Rust Solution
Intuition\n\n# Approach\n\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(n)\n\n# Code\n\n#[derive(Default)]\nstruct Trie {\n    cnt: usize,\n  
# Intuition\n\n# Approach\n\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(n)\n\n# Code\n```\n#[derive(Default)]\nstruct Trie {\n    cnt: usize,\n    children: [Option<Box<Trie>>; 27],\n}\n\nimpl Solution {\n    pub fn sum_prefix_scores(words: Vec<String>) -> Vec<i32> {\n        let mut root = Trie::default();\n\n        for word in words.iter() {\n            let mut curr = &mut root;\n            \n            for c in word.chars().map(|x| x as usize - \'a\' as usize) {\n                curr = curr.children[c].get_or_insert_with(Default::default);\n                curr.cnt += 1;\n            }\n        }\n\n        let mut res = vec![0; words.len()];\n\n        for (i, word) in words.into_iter().enumerate() {\n            let mut cnt = 0;\n            let mut curr = &root;\n\n            for c in word.chars().map(|x| x as usize - \'a\' as usize) {\n                curr = curr.children[c].as_ref().unwrap();\n                cnt += curr.cnt;\n            }\n\n            res[i] = cnt as _;\n        }\n\n        res\n    }\n}\n```
['Rust']