The second Ruby project from The Odin Project The function returns a hash whose key is the sub-strings of the given first argument and the number of times that the sub-string was found in the array passed as the second argument.
get_sub_strings(String, Array)
Hash where value is Integer.
- The String#scan method search for the substrings and returns the list of them.
- Conditional statement in short hand form.