Ad
  • Default User Avatar

    language PHP 7.0

    $this->assertEquals(last($string), $answer);
    
    • expected and actual mixed up positions.

    • If two words have the same last letter, they returned array should show them in the order they appeared in the given string.
      thats wrong to!

    Input string:
    uvrov kltfopf erzf ixdm
    
    Failed asserting that two arrays are equal.
    Actual: Array (
        0 => 'kltfopf'
        1 => 'erzf'
        2 => 'ixdm'
        3 => 'uvrov'
    )
    Expected: Array (
        0 => 'erzf'
        1 => 'kltfopf'
        2 => 'ixdm'
        3 => 'uvrov'
    )