KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am struggling to write a clean method which when passed an array of strings and x returns a randomised list of array elements totalling x, eg. def getrandomarrayelements(thearray, howmany) return [something] end Yes I should submit my existing code, which whilst works is not good, it's 8 lines long and I have a feeling it can be done in one?!
Tags (comma-separated)
Save Edits
Cancel