Skip to content

Instantly share code, notes, and snippets.

@ewhitebloom
Created November 15, 2015 21:49
Show Gist options
  • Save ewhitebloom/e114e4e86ce51c701ffa to your computer and use it in GitHub Desktop.
Save ewhitebloom/e114e4e86ce51c701ffa to your computer and use it in GitHub Desktop.
Bjorn's Hired.com Test
def solution(a,b)
whole_squares = 0
(a..b).to_a.each do |i|
whole_squares += 1 if Math.sqrt(i) % 1 == 0
end
whole_squares
end
puts solution(4, 17)
def sentence_solver(s)
sentences = s.split(/[\.?!]/)
sentences = sentences.map { |sen| sen.split(' ').length }
sentences.max
end
print sentence_solver("Forget CVs..Save time . x x")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment