Deployment Code Feedback

A deployment pipeline hides a numeric access code secret. An engineer submits an attempted code guess of the same length. The system returns feedback in the form xAyB:

  • x bulls: digits that are correct and in the exact position (secret[i] == guess[i]).
  • y cows: digits that exist in both codes but are in the wrong position. A digit counted as a bull is not counted again as a cow, and frequency matters: if a digit appears k times across the two codes, it contributes at most k total matches.

Both secret and guess consist only of digits 0-9. Return the feedback string "{bulls}A{cows}B".

Count bulls by exact-position comparison first, then count total digit-frequency overlaps and subtract bulls to obtain cows.

Examples
Input: ["1807","7810"]
Output: "1A3B"
Hints

Deployment Code Feedback

A deployment pipeline hides a numeric access code `secret`. An engineer submits an attempted code `guess` of the same length. The system returns feedback in the form `xAyB`: