Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Jan 22nd, 2019
76
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.15 KB
| None
|
0
0
raw
download
clone
embed
print
report
function solution(A,B){
let answer = 0;
A.sort((a,b) => a-b);
B.sort((a,b) => b-a);
A.forEach((v,i) => answer += v*B[i])
return answer;
}
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
PHP | 2 min ago | 2.73 KB
prosentase
PHP | 7 min ago | 7.57 KB
Scrolling Text rev_02
Arduino | 28 min ago | 2.13 KB
Scrolling Text rev_01
Arduino | 29 min ago | 2.14 KB
C Programming draw Rectangle with mouse coord...
C | 44 min ago | 3.80 KB
Minimal prices
JSON | 52 min ago | 0.07 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 💰
GetText | 53 min ago | 0.38 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 55 min ago | 0.39 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!