0
What would be the best way optimise the if statments, I feel other like there is a more short and sweet way to get it done
https://code.sololearn.com/caTKh8ephz0S/?ref=app https://code.sololearn.com/ccsmPazQqRnN/?ref=app
2 Réponses
+ 2
In these cases the while or do while loop are pretty useful:
static int DigitCombiner(int a, int b)
{
int c = b;
do
{
a *= 10;
}
while((c /= 10) > 0);
int sum = a + b;
return sum;
}
0
Thanks, thats a very creative solution