Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Unique integers in a 2D array

Challenge

  • Create a method that output unique values in a 2D array

  • Ensure your tests are passing

Approach & Efficiency

  1. A method to remove collision using Hashset
  2. create a hash set to remove collison among duplicates
  3. create a list to return the data
  4. Add all the values to hashset
  5. Add allt the values to a list
  6. Return the list

Solution

Remove Duplicates

Efficiency

  • Space Complexity O(n^2) for a 2d array

  • Time Complexity O(n2) for two for loops in the main method