mirror of
https://github.com/krahets/hello-algo.git
synced 2026-10-30 20:24:45 +08:00
* Retranslate the complete Japanese online edition from Chinese * Fit Japanese homepage labels and localize heading permalinks * Point Japanese contribution instructions to the Japanese preview * Replace locale conditionals with multilingual UI tables
25 lines
598 B
Kotlin
25 lines
598 B
Kotlin
/**
|
|
* File: ListNode.kt
|
|
* Created Time: 2024-01-25
|
|
* Author: curtishd (1023632660@qq.com)
|
|
*/
|
|
|
|
package utils
|
|
|
|
/* 連結リストのノード */
|
|
class ListNode(var _val: Int) {
|
|
var next: ListNode? = null
|
|
|
|
companion object {
|
|
/* リストをデシリアライズして連結リストにする */
|
|
fun arrToLinkedList(arr: IntArray): ListNode? {
|
|
val dum = ListNode(0)
|
|
var head = dum
|
|
for (_val in arr) {
|
|
head.next = ListNode(_val)
|
|
head = head.next!!
|
|
}
|
|
return dum.next
|
|
}
|
|
}
|
|
} |