Distinguishing extra element from two arrays?

后端 未结 19 656
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-28 09:45

One of my friend was asked this question in an interview -

  • You have given two integer arrays each of size 10.
  • Both contains 9 equal elements (say 1 t
19条回答
  •  不思量自难忘°
    2020-12-28 10:42

    Depending on the language you are using, it might have a built in way to do the array differences. PHP does http://ca3.php.net/array_diff

提交回复
热议问题