<commit_before>=begin Pseudocode
DEFINE a function super fizzbuzz that takes an array
  STORE an empty array
  ITERATE over the array, pushing to the empty array
    If it is not divisible by 3 or 5, just push it
    if it is divisible by 3 push fizz
    if it is divisible by 5 also push buzz
=end


# Initial Solution

# def super_fizzbuzz(array)
#   result = []
#   array.each do |number|
#     if (number % 3 != 0 and number % 5 != 0)
#       result.push(number)
#     else
#       string = ""
#       if (number % 3 == 0)
#         string += "Fizz"
#       end
#       if (number % 5 == 0)
#         string += "Buzz"
#       end
#       result.push(string)
#     end
#   end
#   result
# end

# Refactored Solution

def super_fizzbuzz(array)
  return array.map {|n| n % 3 == 0 ? (n % 5 == 0 ? "FizzBuzz" : "Fizz") : (n % 5 == 0 ? "Buzz" : n)}
end


# Reflection
##What concepts did you review or learn in this challenge?
# I had to figure how to use nested ternaries when refactoring.

##What is still confusing to you about Ruby?
# not sure if anything is, sometimes the syntax gets me but that's about it

##What are you going to study to get more prepared for Phase 1?
# I want to try to make sure to do all the ruby challenges<commit_msg>save chars on one liner<commit_after>=begin Pseudocode
DEFINE a function super fizzbuzz that takes an array
  STORE an empty array
  ITERATE over the array, pushing to the empty array
    If it is not divisible by 3 or 5, just push it
    if it is divisible by 3 push fizz
    if it is divisible by 5 also push buzz
=end


# Initial Solution

# def super_fizzbuzz(array)
#   result = []
#   array.each do |number|
#     if (number % 3 != 0 and number % 5 != 0)
#       result.push(number)
#     else
#       string = ""
#       if (number % 3 == 0)
#         string += "Fizz"
#       end
#       if (number % 5 == 0)
#         string += "Buzz"
#       end
#       result.push(string)
#     end
#   end
#   result
# end

# Refactored Solution

def super_fizzbuzz(array)
  array.map {|n| n % 3 == 0 ? (n % 5 == 0 ? "FizzBuzz" : "Fizz") : (n % 5 == 0 ? "Buzz" : n)}
end


# Reflection
##What concepts did you review or learn in this challenge?
# I had to figure how to use nested ternaries when refactoring.

##What is still confusing to you about Ruby?
# not sure if anything is, sometimes the syntax gets me but that's about it

##What are you going to study to get more prepared for Phase 1?
# I want to try to make sure to do all the ruby challenges
{'fraction_non_alphanumeric': 0.09451341609931918, 'fraction_numerical': 0.015218261914297157, 'mean_word_length': 2.630813953488372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5248519', 'n_tokens_mistral': 858, 'n_tokens_neox': 797, 'n_words': 368}