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 3%
voytxt
#2
56 c.
Top 20%
helbling
DigiZoli
Natanaelel
adh98
CorentinTh
#3
57 c.
Top 23%
MaelkMark
#4
58 c.
Top 30%
Salutations45
Ryan
#5
61 c.
Top 33%
500error
#6
62 c.
Top 40%
cers
Lv0Sys
#7
66 c.
Top 43%
Alex
#8
69 c.
Top 53%
c
Thomasdcrt
KrausRaus
#9
70 c.
Top 60%
greentruff
SephQ
#10
71 c.
Top 63%
Benio
#11
74 c.
Top 67%
maximec-indy
#12
75 c.
Top 70%
Eliott
#13
79 c.
Top 73%
Seboran
#14
82 c.
Top 77%
alexisab
#15
83 c.
Top 80%
justinsullard
#16
84 c.
Top 87%
Mif712
thaispalmer
#17
86 c.
Top 90%
TooBusyForYou
#18
93 c.
Top 93%
madeforlosers
#19
108 c.
Top 97%
ComputerKWasTaken
#20
325 c.
Top 100%
jules