Files
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

2.5 KiB

id, title, challengeType, dashedName
id title challengeType dashedName
697a49e9860d24853adef67f Challenge 194: 2026 Winter Games Day 15: Freestyle Skiing 29 challenge-194

--description--

Given a trick name consisting of two words, determine if it is a valid freestyle skiing trick name.

A trick is valid if the first word is in the list of valid first words, and the second word is in the list of valid second words.

  • The two words will be separated by a single space.

Valid first words:

"Misty"
"Ghost"
"Thunder"
"Solar"
"Sky"
"Phantom"
"Frozen"
"Polar"

Valid second words:

"Twister"
"Icequake"
"Avalanche"
"Vortex"
"Snowstorm"
"Frostbite"
"Blizzard"
"Shadow"

--hints--

is_valid_trick("Polar Vortex") should return True.

({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_valid_trick("Polar Vortex"), True)`)
}})

is_valid_trick("Solar Icequake") should return True.

({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_valid_trick("Solar Icequake"), True)`)
}})

is_valid_trick("Thunder Blizzard") should return True.

({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_valid_trick("Thunder Blizzard"), True)`)
}})

is_valid_trick("Phantom Frostbite") should return True.

({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_valid_trick("Phantom Frostbite"), True)`)
}})

is_valid_trick("Ghost Avalanche") should return True.

({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_valid_trick("Ghost Avalanche"), True)`)
}})

is_valid_trick("Snowstorm Shadow") should return False.

({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_valid_trick("Snowstorm Shadow"), False)`)
}})

is_valid_trick("Solar Sky") should return False.

({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_valid_trick("Solar Sky"), False)`)
}})

--seed--

--seed-contents--

def is_valid_trick(trick_name):

    return trick_name

--solutions--

def is_valid_trick(trick_name):
    valid_first = ["Misty", "Ghost", "Thunder", "Solar", "Sky", "Phantom", "Frozen", "Polar"]
    valid_second = ["Twister", "Icequake", "Avalanche", "Vortex", "Snowstorm", "Frostbite", "Blizzard", "Shadow"]

    words = trick_name.split(" ")
    first, second = words
    return first in valid_first and second in valid_second