链表专题 移除链表元素设计链表反转链表 移除链表元素
移除链表元素(Leetcode:203) 给你一个链表的头节点 head 和一个整数 val ,请你删除链表中所有满足 Node.val val 的节点,并返回 新的头节点 。
/*** Definition for sing…
Kotlin函数作为参数指向不同逻辑(二) fun sum(): (Int, Int) -> Int {return { a, b -> (a b) }
}fun multiplication(): (Int, Int) -> Int {return { a, b -> (a * b) }
}fun math(a: Int, b: Int, foo: (Int, Int) -> Int): Int {ret…