Skip to content

Instantly share code, notes, and snippets.

#Run the code. Read the error message.
#Change the assigned value of sample_avg so that it does not throw an error.
def mean(numbers)
sum = numbers.inject(:+)
return sum / numbers.length
end
@rwpr
rwpr / deaf_aunty.rb
Last active August 29, 2015 14:24 — forked from josh1812/deaf_aunty.rb
# original count/status
ctr = 0
hello = gets.chomp
# print out the raw
puts hello.inspect
# ctr += 1 if hello == ""
# print out what's ctr (iaw status)
# -----------------------------
# SUDOKU
# -----------------------------
# Solve a Sudoku problem in seconds
# create a text file under c:\ drive called "hard sudoku problem.txt" with following text (without # symbol) and then run the code below
#85---24--
#72------9
#--4------
#---1-7--2