Skip to content

Error in Alphabet_Soup.rb #1

@Bartlebyy

Description

@Bartlebyy

This is a fantastic resource!

I know this is an old problem, but I wanted to let you know that there's an error in challenge number 10.

def AlphabetSoup(str)
  str.chars.sort.to_s
end

# Actually returns "[\"e\", \"h\", \"l\", \"l\", \"o\"]"

To solve the problem you need to join all the letters in the array into a string.

def AlphabetSoup(str)
  str.chars.sort.join
end

#  returns "ehllo"

Thanks for sharing!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions