Skip to main content
Relevant added explanation
Source Link

Rust, 117117 91 bytes

Or 118 if we count 'y'Requires inputs to be lowercased and it might break horrendously on multibyte characters as a vowelper the challenge's allowances. Officially only supports single-byte character input.

|s:&str|s.to_lowercase().split(' ').any(|w|w.starts_with("ill")&&w.chars&&()w.nthlen(3).is_none_or(|c|<4||!"aiou""aiouy".contains(c&w[3..4])))

Ungolfed and explained:

// Non-regex answer; unless depending on flavor-specific behavior, there's two
// there's two regex answers already, they're just tagged as JS (ES6)
fn sick(album: &str) -> bool {
  // Rely on implicit returns
  album.to_lowercase() // explains itself
    .split(' ') // split on literal space and iterate over the words
    .any(|word|{ // Check if any of the splits matchesmatch a predicate function
      word.starts_with("ill") // explains itself
      && (
        word.charslen()<4 // iterate"ill" overis the charswhole thatword, makesick
 up       // OR the stringtitle does not match the pattern of false positives
        || !"aiouy".nthcontains(3&w[3..4]) // getso theit's charactersick
 with 0-based index 3    // Rust doesn't allow byte indexing of strings, ifas itsome existsindices
        .is_none_or( // If themay charnot doesbe notwhole existcharacters, the wordit *is*does ill
allow indexing ranges
        // OtherwiseSo wethis returnis theeffectively result&w[3], ofbut ait checkingpanics function
if the char at
       |c|!"aiou".contains(c) // non-ethis vowelposition checkhappens to skipbe falsemore positives
than one byte long
      )
    })
}

Rust Playground linkRust Playground link

Rust, 117 bytes

Or 118 if we count 'y' as a vowel.

|s:&str|s.to_lowercase().split(' ').any(|w|w.starts_with("ill")&&w.chars().nth(3).is_none_or(|c|!"aiou".contains(c)))

Ungolfed and explained:

// Non-regex answer; unless depending on flavor-specific behavior, there's two
// regex answers already, they're just tagged as JS (ES6)
fn sick(album: &str) -> bool {
  // Rely on implicit returns
  album.to_lowercase() // explains itself
    .split(' ') // split on literal space and iterate over the words
    .any(|word|{ // Check if any of the splits matches a predicate function
      word.starts_with("ill") // explains itself
      && word.chars() // iterate over the chars that make up the string
        .nth(3) // get the character with 0-based index 3, if it exists
        .is_none_or( // If the char does not exist, the word *is* ill
          // Otherwise we return the result of a checking function
          |c|!"aiou".contains(c) // non-e vowel check to skip false positives
        )
    })
}

Rust Playground link

Rust, 117 91 bytes

Requires inputs to be lowercased and it might break horrendously on multibyte characters as per the challenge's allowances. Officially only supports single-byte character input.

|s:&str|s.split(' ').any(|w|w.starts_with("ill")&&(w.len()<4||!"aiouy".contains(&w[3..4])))

Ungolfed and explained:

// Non-regex answer; unless depending on flavor-specific behavior, 
// there's two regex answers already, they're just tagged as JS (ES6)
fn sick(album: &str) -> bool {
  // Rely on implicit returns
  album
    .split(' ') // split on literal space and iterate over the words
    .any(|word| // Check if any of the splits match a predicate
      word.starts_with("ill") // explains itself
      && (
        word.len()<4 // "ill" is the whole word, sick
        // OR the title does not match the pattern of false positives
        || !"aiouy".contains(&w[3..4]) // so it's sick
        // Rust doesn't allow byte indexing of strings, as some indices
        // may not be whole characters, it does allow indexing ranges
        // So this is effectively &w[3], but it panics if the char at
        // this position happens to be more than one byte long
      )
    )
}

Rust Playground link

Source Link

Rust, 117 bytes

Or 118 if we count 'y' as a vowel.

|s:&str|s.to_lowercase().split(' ').any(|w|w.starts_with("ill")&&w.chars().nth(3).is_none_or(|c|!"aiou".contains(c)))

Ungolfed and explained:

// Non-regex answer; unless depending on flavor-specific behavior, there's two
// regex answers already, they're just tagged as JS (ES6)
fn sick(album: &str) -> bool {
  // Rely on implicit returns
  album.to_lowercase() // explains itself
    .split(' ') // split on literal space and iterate over the words
    .any(|word|{ // Check if any of the splits matches a predicate function
      word.starts_with("ill") // explains itself
      && word.chars() // iterate over the chars that make up the string
        .nth(3) // get the character with 0-based index 3, if it exists
        .is_none_or( // If the char does not exist, the word *is* ill
          // Otherwise we return the result of a checking function
          |c|!"aiou".contains(c) // non-e vowel check to skip false positives
        )
    })
}

Rust Playground link