Question: Hello I am wondering how do you convert a 2D array to a 1D array without hardcoding and using inbuilt libraries in java For example
Hello I am wondering how do you convert a 2D array to a 1D array without hardcoding and using inbuilt libraries in java
For example if the 2D array = {{80, 90}, {10}, {}, {40, 30, 10}, {}} it should return {80, 90, 10, 40, 30, 10}
public int[] combine() { return new int[0]; }
Also I am not quite sure how you populate an array without using inbuilt libraries and hardcoding
public Rational(int[][] pop) { stats = pop; }
Last question how do you return the number of sub-arrays without using inbuilt libraries and hard coding
public int number() { return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
