Skip to content

Instantly share code, notes, and snippets.

@erukiti
Created May 27, 2015 17:33
Show Gist options
  • Save erukiti/0e56ea32b8c495173271 to your computer and use it in GitHub Desktop.
Save erukiti/0e56ea32b8c495173271 to your computer and use it in GitHub Desktop.
問題4 正しいバージョン (でも答え見ちゃった…)
#! /usr/bin/env coffee
p4 = (lists) ->
lists.sort((a, b) -> (b.toString() + a.toString()) - (a.toString() + b.toString())).map((n) -> n.toString()).join('')
console.log(p4([50, 2, 1, 9]))
console.log(p4([50, 2, 1, 5, 56]))
console.log(p4([42, 423, 420]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment