gistlib
other ruby categories
iteration code snippets in ruby
can you patiently explain what happens in this? `words_array.each do |word| word_counts[word] ||= 0 word_counts[word] += 1 end` in ruby
count instances of an element inside an array in ruby
count words in array in ruby
create a loop in ruby
find all the strings matching ‘tony’ in an array of strings, then return how many there are. if there are none then return nil in ruby
find the average of all nodes in a linked list in ruby
find the mode of all nodes in a linked list in ruby
find the standard deviation of all keys in a map in ruby
given a string of digits, output all the contiguous substrings of length n in that string in the order that they appear. in ruby
how to calculate prime numebrs in ruby
how to iterate over each elements of "the quick brown fox jumps over the lazy dog" to check if they exist in [*'a'..'z']? ignore white space in ruby
iterate an array of strings with index in ruby
iterate over a list in ruby
iterate over an array of strings with index using the map function in ruby
iterate through json variables in ruby
teach me array#each what it does and how? in ruby
what does "iterating over consecutive elements" mean and show example in ruby
gistlib
by LogSnag