Construct an Array such that cube sum of all element is a perfect square | Function to create and print the array ; Initialise the array of size N ; Print the array ; Driver code
def constructArray ( N ) : NEW_LINE INDENT arr = [ 0 ] * N NEW_LINE for i in range ( 1 , N + 1 ) : NEW_LINE INDENT arr [ i - 1 ] = i ; NEW_LINE DEDENT for i in range ( N ) : NEW_LINE INDENT print ( arr [ i ] , end = " , ▁ " ) NEW_LINE DEDENT DEDENT N = 6 ; NEW_LINE constructArray ( N ) ; NEW_LINE