top of page

Edabit Java: Combinations, Medium Difficulty


Solving this question in Edabit: https://edabit.com/challenge/wp3vZEmhEgCY42WAZ using Varargs to multiply numbers

  • Solid Question did not know about this before

  • it was fun!


Question:


Answer:


public class Challenge {

public static int combinations(int ... num) {

int sum = 1;

for(int i : num) {

if(i == 0) {

continue;

} else

sum *= i;

}

return sum;

}

}


2 views0 comments
Post: Blog2_Post
bottom of page