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.0 KiB

id, title, challengeType, dashedName
id title challengeType dashedName
697a49e9860d24853adef67f Challenge 194: 2026 Winter Games Day 15: Freestyle Skiing 28 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--

isValidTrick("Polar Vortex") should return true.

assert.isTrue(isValidTrick("Polar Vortex"));

isValidTrick("Solar Icequake") should return true.

assert.isTrue(isValidTrick("Solar Icequake"));

isValidTrick("Thunder Blizzard") should return true.

assert.isTrue(isValidTrick("Thunder Blizzard"));

isValidTrick("Phantom Frostbite") should return true.

assert.isTrue(isValidTrick("Phantom Frostbite"));

isValidTrick("Ghost Avalanche") should return true.

assert.isTrue(isValidTrick("Ghost Avalanche"));

isValidTrick("Snowstorm Shadow") should return false.

assert.isFalse(isValidTrick("Snowstorm Shadow"));

isValidTrick("Solar Sky") should return false.

assert.isFalse(isValidTrick("Solar Sky"));

--seed--

--seed-contents--

function isValidTrick(trickName) {

  return trickName;
}

--solutions--

function isValidTrick(trickName) {
  const validFirst = ["Misty", "Ghost", "Thunder", "Solar", "Sky", "Phantom", "Frozen", "Polar"];
  const validSecond = ["Twister", "Icequake", "Avalanche", "Vortex", "Snowstorm", "Frostbite", "Blizzard", "Shadow"];

  const words = trickName.split(" ");
  const [first, second] = words;
  return validFirst.includes(first) && validSecond.includes(second);
}