Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug][javascript] merge-k-sorted-lists #1574

Open
2 tasks done
Jayden12138 opened this issue Apr 23, 2024 · 0 comments · May be fixed by #1575
Open
2 tasks done

[bug][javascript] merge-k-sorted-lists #1574

Jayden12138 opened this issue Apr 23, 2024 · 0 comments · May be fixed by #1575
Labels
help wanted Extra attention is needed

Comments

@Jayden12138
Copy link

请在提交 bug 之前先搜索

  • 我已经搜索过 issues,没有发现相同的 bug。

出错的题目链接

https://leetcode.cn/problems/merge-k-sorted-lists/

报错信息

出错信息如下:

Line 12 in solution.js
           pq.add(head);
              ^
TypeError: pq.add is not a function
   Line 12: Char 16 in solution.js (mergeKLists)
   Line 36: Char 19 in solution.js (Object.<anonymous>)
   Line 16: Char 8 in runner.js (Object.runner)
   Line 27: Char 26 in solution.js (Object.<anonymous>)
   at Module._compile (node:internal/modules/cjs/loader:1376:14)
   at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
   at Module.load (node:internal/modules/cjs/loader:1207:32)
   at Module._load (node:internal/modules/cjs/loader:1023:12)
   at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
   at node:internal/main/run_main_module:28:49
Node.js v20.10.0

What are the environments for the programming languages?一文中描述,对于javascript没有原生支持PriorityQueue,所以通过引入了第三方库进行实现
image

datastructures-js/priority-queue 库中描述,compare入参形式以及“insert value”method name有些许出入,为了代码可以在leetcode中通过,需要进行一点小小修改

你是否愿意提交 PR 修复这个 bug?

  • 我愿意!
@Jayden12138 Jayden12138 added the help wanted Extra attention is needed label Apr 23, 2024
@Jayden12138 Jayden12138 linked a pull request Apr 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant