/**
 @author Farheen Bano
  
 Reference-
 https://leetcode.com/problems/delete-node-in-a-linked-list/
*/

import java.util.*;
import java.lang.*;
import java.io.*;

/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode(int x) { val = x; }
 * }
 */
class Solution {
    public void deleteNode(ListNode node) {
        node.val = node.next.val;
        node.next = node.next.next;
    } 
    //T(n)=O(1) 
}
