Given an array of integers and two integers k1 and k2, find the sum of all elements between the k1'th and k2'th smallest elements of the array.
{
"nums": [
20,
8,
22,
4,
12,
10,
14
],
"k1": 3,
"k2": 6
}26{
"nums": [
10,
2,
50,
12,
48,
13
],
"k1": 2,
"k2": 6
}73{
"nums": [
1,
2,
3,
4,
5,
6
],
"k1": 1,
"k2": 6
}14Sign in to Run Code and Submit