Three
Three
Three
----------------------------------------------------------------------
-----------
//valid Paranthesis
Input: s = "()[]{}"
Output: true
----------------------------------------------------------------------
-----------
// Maximum Subarray
----------------------------------------------------------------------
-----------
//Climbing Stairs
Input: n = 3
Output: 3
Explanation: There are three ways to climb to the top.
1. 1 step + 1 step + 1 step
2. 1 step + 2 steps
3. 2 steps + 1 step
----------------------------------------------------------------------
//count inversions
mergeSort(arr,0,n-1);
System.out.println(count);
}
public static int[] mergeSort(int[] arr, int start, int end){
if(start==end){
int[] b = new int[1];
b[0] = arr[start];
return b;
}
return merged;
}
5
2 4 1 3 5
ans: 3
------------------------------------------------------------------