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 23%
Natanaelel
CorentinTh
Lv0Sys
helbling
adh98
DigiZoli
#3
57 c.
Top 26%
MaelkMark
#4
58 c.
Top 32%
Salutations45
Ryan
#5
61 c.
Top 35%
500error
#6
62 c.
Top 39%
cers
#7
66 c.
Top 42%
Alex
#8
69 c.
Top 52%
Thomasdcrt
KrausRaus
c
#9
70 c.
Top 58%
SephQ
greentruff
#10
71 c.
Top 61%
Benio
#11
74 c.
Top 68%
Bull
maximec-indy
#12
75 c.
Top 71%
Eliott
#13
79 c.
Top 74%
Seboran
#14
82 c.
Top 77%
alexisab
#15
83 c.
Top 81%
justinsullard
#16
84 c.
Top 87%
Mif712
thaispalmer
#17
86 c.
Top 90%
TooBusyForYou
#18
93 c.
Top 94%
madeforlosers
#19
108 c.
Top 97%
ComputerKWasTaken
#20
325 c.
Top 100%
jules