mirror of
https://github.com/krahets/hello-algo.git
synced 2026-09-03 13:47:13 +00:00
feat(Kotlin): Replace value with _val (#1254)
* ci(kotlin): Add workflow file. * Update kotlin.yml * style(kotlin): value -> _val --------- Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
package utils
|
||||
|
||||
/* 链表节点 */
|
||||
class ListNode(var value: Int) {
|
||||
class ListNode(var _val: Int) {
|
||||
var next: ListNode? = null
|
||||
|
||||
companion object {
|
||||
@@ -15,8 +15,8 @@ class ListNode(var value: Int) {
|
||||
fun arrToLinkedList(arr: IntArray): ListNode? {
|
||||
val dum = ListNode(0)
|
||||
var head = dum
|
||||
for (value in arr) {
|
||||
head.next = ListNode(value)
|
||||
for (_val in arr) {
|
||||
head.next = ListNode(_val)
|
||||
head = head.next!!
|
||||
}
|
||||
return dum.next
|
||||
|
||||
Reference in New Issue
Block a user