Top rank per group: Difference between revisions

m
m (→‎{{header|EchoLisp}}: deleted excess </lang>)
Line 1,247:
<lang dyalect>type Employee(name,id,salary,department)
func Employee.toStringToString() {
"$\(this::.salary) (name: \(this::.name), id: \(this::.id), department: \(this::.department)"
}
Line 1,269:
func topNSalaries(n) {
//We sort employees based on salary
employees.sortSort(by: (x,y) => y::.salary - x::.salary)
let max =
if n > employees.lenLength() - 1 {
employees.lenLength() - 1
} else {
n
Anonymous user