---
# System prepended metadata

title: 趨勢

---

# 趨勢

## Ming
### No. 2
```python=
def solution2(A):
    A_set = [set(hosp) for hosp in A]
    A_ans = []
    for a_sub in A_set:
        A_ans += a_sub
    duplicates = [numbers for numbers in A_ans if A_ans.count(numbers) > 1]
    return len(set(duplicates))
```
### No. 3
```python=
def solution3(S: str):
    max_ans = 0
    for i in range(len(S)):
        if max_ans >= len(S) - i:
            break
    
        sub_str = S[i:]
        count_letters = [0]*26
        for j in range(len(sub_str)):
            count_letters[ord(sub_str[j]) - 97] += 1
            if check_list_even(count_letters):
                max_ans = max(max_ans, j+1)
    return max_ans

def check_list_even(li):
    for i in set(li):
        if i % 2 != 0:
            return False
    return True
```


## YoDer
```cpp=
def solution1(A, B){
    int min_num = min(A,B);
    int max_num = max(A,B);
    int ans = max_num / 4;
    
    
    for(int i = min_num; i >= 0; i--){
        if (max_num / i + min_num / i == 4){
            ans = i;
            break;
        }
    }
    
    return ans;
}
```