|
The comments of methods of Bag should be enhanced and use executable comments, i.e.,
sortedCounts "Answer with a collection of counts with elements, sorted by decreasing count."
"#(1 2 2 3 1 1 1) asBag sortedCounts >>> {4->1. 2->2. 1->3}"
^(Array new: contents size streamContents: [ :stream | contents associationsDo: [ :each | stream nextPut: each value -> each key ] ]) sort: [:x :y | x >= y ]; yourself
|
|
|
Priority: 5 – Fix If Time
|
|
Status: Work Needed
|
|
Assigned to: Everyone
|
|
Milestone: Later
|
Go to Case
|
|