Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Bulls and Cows

Given a secret and a guess of equal length, print the hint as 'xAyB': x digits are correct in position (bulls), y digits are correct but in the wrong position (cows).

Constraints

1 <= length <= 1000

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.