@@ -0,0 +1,1680 @@
+/**%0AProblem Statement ---%3E %0A  Given the head of a singly linked list and two integers left and right where left %3C= right, reverse the nodes of the list from position left to position right, and return the reversed list.%0A  %0A  Test Case: %0A  Input: head = %5B1,2,3,4,5%5D, left = 2, right = 4%0A  Output: %5B1,4,3,2,5%5D%0A  %0A  */%0A/*%0A * Definition for singly-linked list.%0A * public class ListNode %7B%0A *     int val;%0A *     ListNode next;%0A *     ListNode() %7B%7D%0A *     ListNode(int val) %7B this.val = val; %7D%0A *     ListNode(int val, ListNode next) %7B this.val = val; this.next = next; %7D%0A * %7D%0A */%0Aclass Solution %7B%0A    public ListNode reverseBetween(ListNode head, int left, int right) %7B%0A        if(head==null %7C%7C head.next==null %7C%7C left==right) return head;%0A        %0A        if(head.next.next==null)%7B%0A            ListNode temp = head.next;%0A            ListNode h1 = head;%0A            h1.next = null;%0A            temp.next = h1;%0A            %0A            return temp;%0A        %7D%0A        HashMap%3CInteger,ListNode%3E hm = new HashMap%3C%3E();%0A        int c = 1;%0A        ListNode temp = head;%0A        while(temp!=null)%7B%0A            hm.put(c,temp);%0A            temp = temp.next;%0A            c++;%0A        %7D%0A        %0A        ListNode s1 = hm.get(1);%0A        ListNode e1 = hm.get(left-1);%0A        %0A        ListNode s2 = hm.get(right+1);%0A        ListNode e2 = hm.get(c);%0A        %0A        for(int i=left+1;i%3C=right;i++)%7B%0A            hm.get(i).next = hm.get(i-1);%0A        %7D%0A        if(e1==null)%7B%0A            hm.get(left).next = s2;%0A            return hm.get(right);%0A        %7Delse%7B%0A            e1.next = hm.get(right);%0A            %0A            hm.get(left).next = s2;%0A        %7D%0A        %0A        return s1;%0A        %0A    %7D%0A%7D%0A

Create reverseSubListOfLinkedList.java