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 21%
DigiZoli
helbling
CorentinTh
Natanaelel
adh98
#3
57 c.
Top 24%
MaelkMark
#4
58 c.
Top 31%
Salutations45
Ryan
#5
61 c.
Top 34%
500error
#6
62 c.
Top 41%
cers
Lv0Sys
#7
66 c.
Top 45%
Alex
#8
69 c.
Top 55%
Thomasdcrt
c
KrausRaus
#9
70 c.
Top 59%
SephQ
#10
71 c.
Top 62%
Benio
#11
74 c.
Top 66%
maximec-indy
#12
75 c.
Top 69%
Eliott
#13
79 c.
Top 72%
Seboran
#14
82 c.
Top 76%
alexisab
#15
83 c.
Top 79%
justinsullard
#16
84 c.
Top 86%
thaispalmer
Mif712
#17
86 c.
Top 90%
TooBusyForYou
#18
93 c.
Top 93%
madeforlosers
#19
108 c.
Top 97%
ComputerKWasTaken
#20
325 c.
Top 100%
jules