code

class ListNode:
    def __init__(self,x):
        self.val=x
        self.next=None
 
def listToListNode(input):
    # Generate list from the input
    numbers = [int(x) for x in input().split()]
 
    # Now convert that list into linked list
    new = ListNode(0)
    head = new
    for number in numbers:
        head.next = ListNode(number)
        head = head.next
    return new.next

 

 

 

 

 

 

 

 

 

相关文章:

  • 2022-12-23
  • 2021-09-01
  • 2021-07-14
  • 2022-12-23
  • 2021-09-05
  • 2021-06-03
  • 2021-10-09
  • 2022-12-23
猜你喜欢
  • 2021-04-06
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-08-28
  • 2021-08-24
相关资源
相似解决方案