1002. Find Common Characters Easy
1/**
2 * [1002] Find Common Characters
3 *
4 * Given a string array words, return an array of all characters that show up in all strings within the words (including duplicates). You may return the answer in any order.
5 *
6 * Example 1:
7 * Input: words = ["bella","label","roller"]
8 * Output: ["e","l","l"]
9 * Example 2:
10 * Input: words = ["cool","lock","cook"]
11 * Output: ["c","o"]
12 *
13 * Constraints:
14 *
15 * 1 <= words.length <= 100
16 * 1 <= words[i].length <= 100
17 * words[i] consists of lowercase English letters.
18 *
19 */
20pub struct Solution {}
21
22// problem: https://leetcode.com/problems/find-common-characters/
23// discuss: https://leetcode.com/problems/find-common-characters/discuss/?currentPage=1&orderBy=most_votes&query=
24
25// submission codes start here
26
27impl Solution {
28 pub fn common_chars(words: Vec<String>) -> Vec<String> {
29 vec![]
30 }
31}
32
33// submission codes end
34
35#[cfg(test)]
36mod tests {
37 use super::*;
38
39 #[test]
40 fn test_1002() {
41 }
42}
43
Back
© 2025 bowen.ge All Rights Reserved.