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 19%
Natanaelel
CorentinTh
adh98
DigiZoli
#3
57 c.
Top 22%
MaelkMark
#4
58 c.
Top 30%
Ryan
Salutations45
#5
61 c.
Top 33%
500error
#6
62 c.
Top 41%
cers
Lv0Sys
#7
69 c.
Top 52%
c
KrausRaus
Thomasdcrt
#8
70 c.
Top 56%
SephQ
#9
71 c.
Top 59%
Benio
#10
74 c.
Top 63%
maximec-indy
#11
75 c.
Top 67%
Eliott
#12
79 c.
Top 70%
Seboran
#13
82 c.
Top 74%
alexisab
#14
83 c.
Top 78%
justinsullard
#15
84 c.
Top 85%
thaispalmer
Mif712
#16
86 c.
Top 89%
TooBusyForYou
#17
93 c.
Top 93%
madeforlosers
#18
108 c.
Top 96%
ComputerKWasTaken
#19
325 c.
Top 100%
jules