Closed Faraaz22 closed 1 year ago
Assign this work to me.
Done @yanurag1414 Happy Coding!
@Faraaz22 can you please assign this task to me
Try to solve it in optimise way in real world scenarion it will take linear time O(n) to execute the code. Try to check if its the last node or the only node then delete and return null; Otherwise just swap Nth Node and N+1 Node values then delete N+1 node values Complexity - O(1) Constant time in apriori analysis.
Ok sure @y9rabbito
@y9rabbito can you check the solution and let me know if any changes are required
Kindly assign this to me under hacktober fest.
Problem Given the head of a linked list, remove the nth node from the end of the list and return its head.
Example 1:
Example 2:
Example 3:
Constraints: