From 6e3cd6e8a2eb65b0ba00b4e15e1abeb689a33e8d Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 1 Apr 2024 18:17:24 +0100 Subject: - Added solutions by Mark Anderson. - Added solutions by Thomas Kohler. - Added solutions by Feng Chang. - Added solutions by Peter Meszaros. - Added solutions by Andrew Shitov. - Added solutions by Steven Wilson. - Added solutions by W. Luis Mochan. - Added solutions by James Smith. - Added solutions by Wanderdoc. - Added solutions by Laurent Rosenfeld. - Added solutions by Eric Cheung. --- challenge-263/eric-cheung/python/ch-1.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 challenge-263/eric-cheung/python/ch-1.py (limited to 'challenge-263/eric-cheung/python/ch-1.py') diff --git a/challenge-263/eric-cheung/python/ch-1.py b/challenge-263/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..7c330e0eda --- /dev/null +++ b/challenge-263/eric-cheung/python/ch-1.py @@ -0,0 +1,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) -- cgit