Ruby permutation method rocks!

Early today I was doing my first homework assignment for the SaaS course by University of California – Berkeley, and was making a Rspec test work. This method was meant to take 2 arguments, one array with integers and one integer. What we have to do is sum two numbers in the array until it gets equal to the second argument. Since I come from a Pascal and C background my mind started to think low level, and then I had to say “calm down Adnilson, this is Object Oriented” but, that didn’t keep me from trying. After hitting a wall I went to the Array documentation where I found Ruby’s permutation  method that permitted the program to sum all numbers in the array until it matches n, otherwise returns false. I don’t know if other programming languages have the same method, but this made me feel so happy! Below I will show the code:

def sum_to_n? arr, n
if arr.empty? || arr.length == 1
  false
  elsif arr.permutation(2).any? { |a, b| a + b == n }
    true
  else
    false
  end
end

Taking more than you can handle

Some time ago a friend gave me a coding challenge which I decided to make it in Ruby on Rails, I hesitated because was expecting that an Enterprise would give me a task to build something in JavaScript/HTML/CSS, so the time passed. Then I applied for a company that is hiring any kind of developer that understands how the Full Stack works and got another coding challenge. This time in Nodejs and Express. Perhaps I do not need to say that I have to learn a whole new technology to get the challenge working and net the job. Besides all of this I enrolled in a course from Berkeley University of California called SaaS (Software as a Service) and the framework they use is… You got it! Ruby on Rails!
How am I going to do all of this? Since I like to finish what I’ve started (which sometimes is not possible), I feel stressed about this situation and wasn’t expecting all that’s happening. I heard somewhere that it is not about the how but the why. Why do I want to be a Developer? Why do I want to learn? Why am I pushing through all the resistance? Why do I care about Self-Development and read/listen to a lot of books? The answer is simple, I want to become the best, learn with the best, be on the top 3%. Is it simple or easy? I don’t think so. Do I think it is possible? Absolutely.