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 4%
voytxt
#2
56 c.
Top 17%
Natanaelel
adh98
CorentinTh
#3
58 c.
Top 25%
Salutations45
Ryan
#4
61 c.
Top 29%
500error
#5
62 c.
Top 33%
cers
#6
69 c.
Top 46%
Thomasdcrt
KrausRaus
c
#7
70 c.
Top 50%
SephQ
#8
71 c.
Top 54%
Benio
#9
74 c.
Top 58%
maximec-indy
#10
75 c.
Top 63%
Eliott
#11
79 c.
Top 67%
Seboran
#12
82 c.
Top 71%
alexisab
#13
83 c.
Top 75%
justinsullard
#14
84 c.
Top 83%
Mif712
thaispalmer
#15
86 c.
Top 88%
TooBusyForYou
#16
93 c.
Top 92%
madeforlosers
#17
108 c.
Top 96%
ComputerKWasTaken
#18
325 c.
Top 100%
jules