------
## 最终结论
```python
def getHint(secret, guess):
    bulls = 0
    cows = 0
    # Initialize counters for bulls and cows
    secret_count = {}
    guess_count = {}

    for i in range(len(secret)):
        if secret[i] == guess[i]:
            bulls += 1
        else:
            # Count occurrences of each digit in secret and guess excluding bulls
            secret_count[secret[i]] = secret_count.get(secret[i], 0) + 1
            guess_count[guess[i]] = guess_count.get(guess[i], 0) + 1

    # Calculate cows based on the counts of unmatched digits
    for digit in guess_count:
        if digit in secret_count:
            cows += min(secret_count[digit], guess_count[digit])

    return f"{bulls}A{cows}B"
```