Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab5b8e7

Browse files
committed
[JAVASCRIPT] 347-Top-K-Frquent-Elements solution
1 parent05d2116 commitab5b8e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎javascript/347-Top-K-Frquent-Elements.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ var topKFrequent = function(nums, k) {
1313
map.set(n,(map.has(n) ?1+map.get(n) :1))
1414
}
1515

16-
// Poppulate the bucket with numbers in frequency as the index of the bucket
16+
// Poppulate the bucket with numbers in frequency
17+
// as the index of the bucket
1718
for(let[key,value]ofmap.entries()){
1819
if(!Array.isArray(bucket[value])){
1920
bucket[value]=[];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp