|  | @@ -0,0 +1,20 @@
 | 
	
		
			
				|  |  | +func getHint(secret string, guess string) string {
 | 
	
		
			
				|  |  | +	s, g := make([]int, 10), make([]int, 10)
 | 
	
		
			
				|  |  | +	bulls, cows := 0, 0
 | 
	
		
			
				|  |  | +	for i := range secret {
 | 
	
		
			
				|  |  | +		if secret[i] == guess[i] {
 | 
	
		
			
				|  |  | +			bulls++
 | 
	
		
			
				|  |  | +		} else {
 | 
	
		
			
				|  |  | +			s[int(secret[i]-'0')]++
 | 
	
		
			
				|  |  | +			g[int(guess[i]-'0')]++
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +	for i := 0; i < 10; i++ {
 | 
	
		
			
				|  |  | +		if s[i] < g[i] {
 | 
	
		
			
				|  |  | +			cows += s[i]
 | 
	
		
			
				|  |  | +		} else {
 | 
	
		
			
				|  |  | +			cows += g[i]
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +	return fmt.Sprintf("%dA%dB", bulls, cows)
 | 
	
		
			
				|  |  | +}
 |