Skip to content

AdaGold/array-intersection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Array Intersection

Determine the intersection of two sets of input integer arrays.

Exercise

  • Design and implement a method that takes two integer arrays and returns their intersection. The two input arrays have non repeating elements. The array returned should not have repeating elements.
  • Share and explain the time and space complexities for your solution in the comments above the method.
    • If the complexity is defined in terms of n and m, explain what n and m stand for.
  • If you think of multiple approaches to solve the problem, implement the solution which minimizes space complexity. Explain the other approaches, and your decision in comments above the code.
  • For example,
    • intersection of [2, 3, 4] and [4, 5, 6] is [4]
    • intersection of [50, 43, 25, 72] and [25, 36, 43, 50, 80] is [50, 25, 43]
    • intersection of [9, 30, 42] and [56, 34, 90, 32] is []

Note: Do not use Ruby provided methods.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages