This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rest | |
/** | |
* @author sjalipar | |
*/ | |
import spray.json._ | |
import scala.collection.immutable.ListMap | |
case class Response(time: String, a: Int, b: Int, c: Int, d: Int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author sjalipar | |
*/ | |
object myMain { | |
def main(args: Array[String]): Unit = { | |
println("test - start") | |
import scala.concurrent.Future | |
import scala.util.Success | |
import scala.util.Failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
int[] data = {1,2,3,4,5}; | |
int target = 6; | |
int k = 3; | |
System.out.println("combinations are " + kcombinationSum(data, target, k)); | |
} | |
public static List<List<Integer>> kcombinationSum(int[] data, int target, int k){ | |
Arrays.sort(data); | |
List<List<Integer>> res = new ArrayList<>(); | |
List<Integer> temp = new ArrayList<>(); |