mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-09-08 01:26:57 +02:00
17 lines
244 B
C#
17 lines
244 B
C#
using System;
|
|
|
|
public static class Kata
|
|
{
|
|
public static string AddBinary(int a, int b)
|
|
{
|
|
var sum = a + b;
|
|
var result = "";
|
|
|
|
while (sum > 0) {
|
|
result = $"{sum % 2}" + result;
|
|
sum /= 2;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|