Coded Handshake
A secret handshake can be encoded as a number, where each enabled bit adds one action. The function commands receives number and returns the list of actions it represents. Bits 1, 2, 4, and 8 add wink, double blink, close your eyes, and jump; bit 16 reverses the order of the commands.
Примеры
Ввод
1Вывод
["wink"]Ввод
2Вывод
["double blink"]Ввод
4Вывод
["close your eyes"]Нужно реализовать
def commands(number: int) -> list[str]:
Теги
listsmath
Влез, за да видиш историята на решенията
ВходВлез, за да използваш ИИ ментора
ВходVisible tests
1
Input
1Expected
["wink"]2
Input
2Expected
["double blink"]3
Input
4Expected
["close your eyes"]4
Input
8Expected
["jump"]5
Input
3Expected
["wink","double blink"]6
Input
19Expected
["double blink","wink"]Focus radio
Paused · SomaFM · Fluid