September and Bulls and Cows challenge

The September 10th Challenge (Bulls and Cows).
There is something wrong about this challenge.
First in the problem description there is an example as follows:

Input: secret = "1123", guess = "0111"
Output: "1A1B"
Explanation: The 1st 1 in friend's guess is a bull, the 2nd or 3rd 1 is a cow.

I couldn't understand why this is not "1A2B"

There are three "1", the first one is A, but there are two in the wrong place.
So I changed my understanding and I asuumed that we are taking character occurance only oncee in case of Bs only?
So I changed the logic to make (1123, 0111) to return (1A1B)

But then later in another test case
("1122", "2211") it should return "2B" according to previous logic
But it is supposed to return "4B"

So either first one is worng or second case is wrong

Comments (1)