Last active
September 28, 2022 06:01
-
-
Save ijingo/18ac9da173b597bad4da1df4891083e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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