Skip to content

Instantly share code, notes, and snippets.

@ijingo
Last active September 28, 2022 06:01
Show Gist options
  • Save ijingo/18ac9da173b597bad4da1df4891083e8 to your computer and use it in GitHub Desktop.
Save ijingo/18ac9da173b597bad4da1df4891083e8 to your computer and use it in GitHub Desktop.
public class ListNode {
public int val;
public ListNode next;
public ListNode(int val=0, ListNode next=null) {
this.val = val;
this.next = next;
}
}
public class Solution {
public ListNode ReverseBetween(ListNode head, int left, int right) {
}
}
// case 1:
// input:
// [1, 2, 3, 4, 5]
// 1
// 5
// output:
// [5, 4, 3, 2, 1]
//
// case 2:
// input:
// [1, 2, 3, 4, 5]
// 1
// 2
// output:
// [2, 1, 3, 4, 5]
//
//
// case 3:
// input:
// [1, 2, 3, 4, 5]
// 2
// 4
// output:
// [1, 4, 3, 2, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment