• Asked to answer
    + 1 comment

    Yes, a "growable" array is important to this problem. Look at the constraints. In a 2D array construction, you would need to reserve a 20000x50000 array to make sure you can store all the data sets. That's 4 GB for int! Google "array of arraylist java" for more in-depth discussions.