0

I tried using sets but obviously that doesn't work. I need a function to be able to work like this:

let Array1 = [2,2,1,1]
let Array2 = [2,1,2,1]
let Array3 = [2,2,2,1]

I need my function to be able to recognize that Array1 and Array2 are equal without thinking that Array3 is the same. Any thoughts?

Hamish
  • 78,605
  • 19
  • 187
  • 280
Z-Man Jones
  • 187
  • 1
  • 12
  • What do you mean? Can you explain what you want to do instead of a function to resolve your issue? – James Apr 26 '17 at 21:59
  • 1
    There are a lot of similar questions here, depending of the language. Here is a complete topic on JS for example http://stackoverflow.com/questions/6229197/how-to-know-if-two-arrays-have-the-same-values – picsoung Apr 26 '17 at 22:00
  • Basically I need the count of how many 1s or 2s there are in a given array – Z-Man Jones Apr 26 '17 at 22:00

0 Answers0