KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
There's probably a more efficient and more Ruby-ish way to do this: # Pad array to size n by adding x's. Don't do anything if n <= a.length. def padleft(a, n, x) return a if n <= a.length return padleft([x] + a, n, x) end What would you suggest?
Tags (comma-separated)
Save Edits
Cancel