top of page

Edabit Java: Combinations, Medium Difficulty

  • May 25, 2021
  • 1 min read

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:

ree

Answer:

ree

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;

}

}


Comments


Post: Blog2_Post

©2021 by IPengieWoo. Proudly created with Wix.com

bottom of page