mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 04:31:55 +08:00
fix: adapt missing ruby style guide (#1216)
This commit is contained in:
@ -17,10 +17,10 @@ end
|
||||
|
||||
### 将列表反序列化为链表 ###
|
||||
def arr_to_linked_list(arr)
|
||||
head = current = ListNode.new arr[0]
|
||||
head = current = ListNode.new(arr[0])
|
||||
|
||||
for i in 1...arr.length
|
||||
current.next = ListNode.new arr[i]
|
||||
current.next = ListNode.new(arr[i])
|
||||
current = current.next
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user