mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-21 02:56:11 +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:
@@ -41,7 +41,7 @@ fun find(head: ListNode?, target: Int): Int {
|
||||
var index = 0
|
||||
var h = head
|
||||
while (h != null) {
|
||||
if (h.value == target)
|
||||
if (h._val == target)
|
||||
return index
|
||||
h = h.next
|
||||
index++
|
||||
@@ -79,7 +79,7 @@ fun main() {
|
||||
|
||||
/* 访问节点 */
|
||||
val node: ListNode = access(n0, 3)!!
|
||||
println("链表中索引 3 处的节点的值 = ${node.value}")
|
||||
println("链表中索引 3 处的节点的值 = ${node._val}")
|
||||
|
||||
/* 查找节点 */
|
||||
val index: Int = find(n0, 2)
|
||||
|
||||
Reference in New Issue
Block a user