aboutsummaryrefslogtreecommitdiff
path: root/challenge-263/eric-cheung/python/ch-1.py
blob: 7c330e0edaf57d800ec010eea8a4dff59fdc106e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
## Example 1
## arrInt = [1, 5, 3, 2, 4, 2]
## nK = 2

## Example 2
## arrInt = [1, 2, 4, 3, 5]
## nK = 6

## Example 3
arrInt = [5, 3, 2, 4, 2, 1]
nK = 4

arrOutput = [nIndxLoop for nIndxLoop, elemLoop in enumerate(sorted(arrInt)) if elemLoop == nK]

print (arrOutput)