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 22%
CorentinTh
helbling
adh98
Lv0Sys
Natanaelel
DigiZoli
#3
57 c.
Top 25%
MaelkMark
#4
58 c.
Top 34%
Ryan
Salutations45
XenThe
#5
61 c.
Top 38%
500error
#6
62 c.
Top 41%
cers
#7
66 c.
Top 44%
Alex
#8
69 c.
Top 53%
KrausRaus
c
Thomasdcrt
#9
70 c.
Top 59%
SephQ
greentruff
#10
71 c.
Top 63%
Benio
#11
74 c.
Top 69%
Bull
maximec-indy
#12
75 c.
Top 72%
Eliott
#13
79 c.
Top 75%
Seboran
#14
82 c.
Top 78%
alexisab
#15
83 c.
Top 81%
justinsullard
#16
84 c.
Top 88%
Mif712
thaispalmer
#17
86 c.
Top 91%
TooBusyForYou
#18
93 c.
Top 94%
madeforlosers
#19
108 c.
Top 97%
ComputerKWasTaken
#20
325 c.
Top 100%
jules