• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

fxss5201 / fxss-leetcode / 14559966275

20 Apr 2025 01:30PM CUT coverage: 96.345% (-0.04%) from 96.385%
14559966275

push

github

fxss5201
feat: 增加 14. 第一个元素、18. 获取元组长度、43. 实现 Exclude

1014 of 1091 branches covered (92.94%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 1 file covered. (0.0%)

3652 of 3752 relevant lines covered (97.33%)

6.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.69
/src/leetcode/mergeTwoLists/javascript.js
1
// 21. 合并两个有序链表:https://leetcode.cn/problems/merge-two-sorted-lists/description/
1✔
2
// 输入:l1 = [1,2,4], l2 = [1,3,4]
1✔
3
// 输出:[1,1,2,3,4,4]
1✔
4

1✔
5
import { ListNodeJs } from "../../utilsJs"
1✔
6

1✔
7
export function mergeTwoLists (list1, list2) {
1✔
8
  const head = new ListNodeJs(0)
1✔
9
  let main = head
1✔
10
  while (list1 && list2) {
1!
11
    if (list1?.val < list2?.val) {
×
12
      main.next = list1
×
13
      list1 = list1.next
×
14
    } else {
×
15
      main.next = list2
×
16
      list2 = list2.next
×
17
    }
×
18
    main = main.next
×
19
  }
×
20
  if (list1) main.next = list1
1!
21
  if (list2) main.next = list2
1✔
22
  return head.next
1✔
23
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc