Closed githubeyaneu closed 9 years ago
I have a value and a function with the same name (min).
I am not sure if it should run or give an error, but doing nothing seems incorrect.
Thanks for your work: Andras
The Code:
package programmingpraxis object ClosestTwoSumToZero { val input = List(45, -29, -96, -7, -17, 72, -60) val pairs = (for(i1 <- input; i2<-input.filter { x => x!=i1 }) yield (i1,i2)) val min = pairs.map(x=>(x._1+x._2).abs).min val minPair = pairs.filter(x=>x._1+x._2==min) val inputS = input.sorted def min(input: List[Int], min:Tuple2[Int,Int]):Tuple2[Int,Int]={ (1,1) } min(inputS,(-100,100)) }
Scala IDE version: 4.1.0.v-2_11-201505250839-aeb633d Scala compiler version: 2.11.6 Scala library version: 2.11.6 Eclipse version: 4.4.2.v20150204-1700 Class loader store: 2 entries Compiler v. 2.10.5(C:/DEVELOPING_1/tools/eclipseScala/plugins/org.scala-ide.scala210.jars_4.1.0.201505250838/target/jars/scala-compiler.jar) Compiler v. 2.11.6(C:/DEVELOPING_1/tools/eclipseScala/plugins/org.scala-lang.scala-compiler_2.11.6.v20150224-172222-092690e7bf.jar)
Most likely a duplicate of #222
I have a value and a function with the same name (min).
I am not sure if it should run or give an error, but doing nothing seems incorrect.
Thanks for your work: Andras
The Code: