8 lines
162 B
Ruby
8 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
|