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%
adh98
CorentinTh
Natanaelel
#3
58 c.
Top 22%
Salutations45
#4
61 c.
Top 26%
500error
#5
62 c.
Top 30%
cers
#6
69 c.
Top 43%
c
KrausRaus
Thomasdcrt
#7
70 c.
Top 48%
SephQ
#8
71 c.
Top 52%
Benio
#9
74 c.
Top 57%
maximec-indy
#10
75 c.
Top 61%
Eliott
#11
79 c.
Top 65%
Seboran
#12
82 c.
Top 70%
alexisab
#13
83 c.
Top 74%
justinsullard
#14
84 c.
Top 83%
Mif712
thaispalmer
#15
86 c.
Top 87%
TooBusyForYou
#16
93 c.
Top 91%
madeforlosers
#17
108 c.
Top 96%
ComputerKWasTaken
#18
325 c.
Top 100%
jules