text: 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
code: function constructArray ( N ) { let arr = new Array ( N ) ; for ( let i = 1 ; i <= N ; i ++ ) { arr [ i - 1 ] = i ; } for ( let i = 0 ; i < N ; i ++ ) { document . write ( arr [ i ] + " " ) ; } } let N = 6 ; constructArray ( N ) ;