Ruby Can You Write The Shortest or Fastest Code?

zfben · December 24, 2011 · Last by camel replied at February 04, 2012 · 2467 hits

http://www.therubygame.com

这个网站有道题目,你可以提交你的答案,

然后它会自动判断谁的代码最短、最快,当然,也可以看谁的最长,最慢:p

gifts.split("\n").reverse.slice(0,day).map{|a|b=a.split(" ").first;b.eql?("A")?1:b.to_i}.inject{|sum,n|sum+n}

这周题目比较简单,写了一个竟然发现已有雷同:<

You need to Sign in before reply, if you don't have an account, please Sign up first.