Intersection Sum

Sum the intersection of two integer arrays.

Easy5/19/2024

Problem statement

Given two integer arrays, return the sum of the intersection of both arrays.

Note:

  • the integers can be negative
  • arrays can have duplicates
  • the intersection can be empty
  • the arrays can be of different lengths

Problem leaderboard

#
Size
%
Users
#1
47 c.
Top 5%
voytxt
#2
56 c.
Top 18%
adh98
CorentinTh
Natanaelel
#3
58 c.
Top 23%
Salutations45
#4
61 c.
Top 27%
500error
#5
62 c.
Top 32%
cers
#6
69 c.
Top 41%
KrausRaus
Thomasdcrt
#7
70 c.
Top 45%
SephQ
#8
71 c.
Top 50%
Benio
#9
74 c.
Top 55%
maximec-indy
#10
75 c.
Top 59%
Eliott
#11
79 c.
Top 64%
Seboran
#12
82 c.
Top 68%
alexisab
#13
83 c.
Top 73%
justinsullard
#14
84 c.
Top 82%
Mif712
thaispalmer
#15
86 c.
Top 86%
TooBusyForYou
#16
93 c.
Top 91%
madeforlosers
#17
108 c.
Top 95%
ComputerKWasTaken
#18
325 c.
Top 100%
jules