Construct an Array of size N whose sum of cube of all elements is a perfect square | Java implementation of the above approach ; Function to construct an array of size N ; Prints the first N natural numbers ; Driver Code
class GFG { public static void constructArray ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) { System . out . print ( i + " ▁ " ) ; } } public static void main ( String [ ] args ) { int N = 5 ; constructArray ( N ) ; } }