Run time error on Last executed input: {}


  • 0
    N

    Hi there,

    My code works fine on my own computer, when the input list is empty, i.e., head is null (I added null check in my code). However, I got this "Run time error" on "Last executed input: {}". Can anyone help me with this?

    Thanks!


  • 0

    Do not declare or define ListNode in your code. I removed it and your code runs fine.


  • 0
    N

    Thank you so much for your help! This solved my problem!=)


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.