human
Write me a code to count three and the other steps required given the following:
Count three | Function to count three - digit numbers having difference x with its reverse.
If x is not multiple of 99.
No solution exists.
Generate all possible pairs of digits [ 1 , 9 ].
If any pair is obtained with difference x / 99.
Increase count.
Return the count.
Driver Code"
Solution in Python:
assistant
#Here is code to count three and the other steps required.
 def Count_Number ( x ) :
	ans = 0 ;
	if ( x % 99 != 0 ) :
		ans = - 1 ;
	else :
		diff = x / 99 ;
		for i in range ( 1 , 10 ) :
			for j in range ( 1 , 10 ) :
				if ( ( i - j ) == diff ) :
					ans += 10 ;
	return ans ;
if __name__ == ' _ _ main _ _ ' :
	x = 792 ;
	print ( Count_Number ( x ) ) ;