DEV Community

Discussion on: Daily Challenge #60 - Find the Missing Letter

Collapse
 
peter279k profile image
peter279k

Here is PHP solution with chr and ord functions:

function find_missing_letter(array $array): string {
    $start = ord($array[0]);

    foreach($array as $char) {
        if ($char !== chr($start)) {
            return chr($start);
        }

        $start++;
    }


}