human
Check if a number ends with another number or not | Function to check if B is a suffix of A or not.
Convert numbers into strings.
Find the lengths of strings s1 and s2.
Base Case.
Traverse the strings s1 & s2.
If at any index characters are unequals then return false.
Return true.
Given numbers.
Function Call.
If B is a suffix of A , then print " Yes ""
Solution in Python:
assistant
#Here is code to check if a number ends with another number or not and the other steps required.
 def checkSuffix ( A , B ) :
	s1 = str ( A ) ;
	s2 = str ( B ) ;
	n1 = len ( s1 )
	n2 = len ( s2 )
	if ( n1 < n2 ) :
		return False ;
	for i in range ( n2 ) :
		if ( s1 [ n1 - i - 1 ] != s2 [ n2 - i - 1 ] ) :
			return False ;
	return True ;
A = 12345
B = 45 ;
result = checkSuffix ( A , B ) ;
if ( result ) :
	print ( " Yes " )
else :
	print ( " No " )