Ruby - Methods - Arguments

Sort by

recency

|

73 Discussions

|

  • + 0 comments
    def take(s, len =1)
        s[len..]
    end
    
  • + 0 comments
    def take(arr, skip=1)
        arr.shift(skip)
        arr
    end
    
  • + 0 comments

    Ruby compiled Solutions https://github.com/LinaOrmos/Ruby/tree/main

  • + 0 comments
    Your code here

    def take(arr,pos=1) return [] if pos >= arr.length return arr[(pos)..(arr.length)] end

  • + 0 comments

    def take(nums, len=1) nums[len, nums.length] end