human
Check if a number can be represented as product of two positive perfect cubes | Function to check if N can be represented as the product of two perfect cubes or not.
Stores the perfect cubes.
Traverse the Map.
Stores the first number.
Stores the second number.
Search the pair for the first number to obtain product N from the Map.
If N cannot be represented as the product of the two positive perfect cubes.
Driver Code"
How can the above be solved in Python?
 Can you provide a code to check if a number can be represented as product of two positive perfect cubes and the other steps required?
assistant
#Here is code to check if a number can be represented as product of two positive perfect cubes and the other steps required.
 def productOfTwoPerfectCubes ( N ) :
	cubes = { }
	i = 1
	while i * i * i <= N :
		cubes [ i * i * i ] = i
		i += 1
	for itr in cubes :
		firstNumber = itr
		if ( N % itr == 0 ) :
			secondNumber = N // itr
			if ( secondNumber in cubes ) :
				print ( " Yes " )
				return
	print ( " No " )
if __name__ == " _ _ main _ _ " :
	N = 216
	productOfTwoPerfectCubes ( N )