Advent of code 2017/4
Ajax Direct

Answer

Part 1 :
Part 2 :
// ==================================================
// > PART 1
// ==================================================
$solution_1 = $input->lines->filter(fn ($pass) =>
    set(explode(" ", $pass->string))->duplicates()->empty()
)->count();

// ==================================================
// > PART 2
// ==================================================
$solution_2 = $input->lines->filter(fn ($pass) =>
    $pass
        ->split(" ")->map(fn ($word) => $word->chars()->sort()->values()->join()->string)
        ->duplicates()->empty()
)->count();