LC: 369. Plus One Linked List
https://leetcode.com/problems/plus-one-linked-list/
Input: head = [1,2,3]
Output: [1,2,4]Input: head = [0]
Output: [1]/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode() {}
* ListNode(int val) { this.val = val; }
* ListNode(int val, ListNode next) { this.val = val; this.next = next; }
* }
*/
class Solution {
public ListNode plusOne(ListNode head) {
}
}Last updated