Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. method name: 'randSample', type: 'java.util.List<T>', params: [ list: 'java.util.List<T>', min: Integer, max: Integer ]
  2. method name: 'randSample', type: 'java.util.List<T>', params: [ list: 'java.util.List<T>' ]
  3.  
  4. def randSample(List list<T>, Integer min, Integer max) {
  5. shuffle(list).take nextInt(min, max)
  6. }
  7.  
  8. def randSample(List<T> list) {
  9. randSample list, 0, list.size()+1
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement