From 89e79ecac193a71ad957993b8576a57c2b4799e6 Mon Sep 17 00:00:00 2001 From: koronya Date: Tue, 3 Feb 2026 03:39:06 +0900 Subject: [PATCH] [JS][7kyu] We Have Liftoff --- codewars/7kyu/we-have-liftoff/koronya.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 codewars/7kyu/we-have-liftoff/koronya.js diff --git a/codewars/7kyu/we-have-liftoff/koronya.js b/codewars/7kyu/we-have-liftoff/koronya.js new file mode 100644 index 000000000..083a1d998 --- /dev/null +++ b/codewars/7kyu/we-have-liftoff/koronya.js @@ -0,0 +1,11 @@ +// [JS][7kyu] We Have Liftoff +// we-have-liftoff +// https://www.codewars.com/kata/53d6387b83db278202000802/train/javascript + +const liftoff = (instructions) => { + instructions.sort((a, b) => b - a) + return instructions.join(' ') + ' liftoff!' +} + +liftoff([8, 1, 10, 2, 7, 9, 6, 3, 4, 5]) === '10 9 8 7 6 5 4 3 2 1 liftoff!' +liftoff([1, 2, 4, 3, 5]) === '5 4 3 2 1 liftoff!'