9 lines
162 B
Ruby
9 lines
162 B
Ruby
|
# Definition for singly-linked list.
|
||
|
class ListNode
|
||
|
attr_accessor :val, :next
|
||
|
def initialize(val = 0, _next = nil)
|
||
|
@val = val
|
||
|
@next = _next
|
||
|
end
|
||
|
end
|