标签:style blog class code java ext
最近在学scala语言,scala代码如下:
import scala.collection.JavaConversions._ object Solution { def solution(A: Array[Int]): Int = { // write your code in Scala 2.10 // sort scala.util.Sorting.quickSort(A) // enumerate each most possible triangle edges combination for(i <- 2 to A.length-1) { if(A(i-2)>A(i)-A(i-1)) return 1 } return 0 } }
[codility]Triangle,布布扣,bubuko.com
标签:style blog class code java ext
原文地址:http://blog.csdn.net/sunbaigui/article/details/25006801