Ad
  • Custom User Avatar

    Love this solution! Using upto and downto in the context of a lift is just delightful.

    A small improvement (arguably) could be to change stop to a proper bool throughout and then change

    stop = 0
    lift.reject!{|n| n == floor && (stop = 1)}
    

    to

    stop = lift.delete(floor)
    
  • Custom User Avatar

    You could decompose the signature in the method definition if you like: def tribonacci({a,b,c}, n) do