human
Check if a number can be represented as a sum of 2 triangular numbers | Function to check if it is possible or not.
Store all triangular numbers up to N in a Set.
Check if a pair exists.
Driver Code"
How can the above be solved in Python?

=====
Write me a code to check if a number can be represented as a sum of 2 triangular numbers and the other steps required?
assistant
#Here is code to check if a number can be represented as a sum of 2 triangular numbers and the other steps required.
 def checkTriangularSumRepresentation ( n ) :
	tri = list ( ) ;
	i = 1 ;
	while ( 1 ) :
		x = i * ( i + 1 ) // 2 ;
		if ( x >= n ) :
			break ;
		tri . append ( x ) ;
		i += 1 ;
	for tm in tri :
		if n - tm in tri :
			return True ;
	return False ;
if __name__ == " _ _ main _ _ " :
	n = 24 ;
	if checkTriangularSumRepresentation ( n ) :
		print ( " Yes " )
	else :
		print ( " No " )