1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-09-08 01:26:57 +02:00
CodeWars/7kyu/binary_addition/solution.cs

18 lines
244 B
C#
Raw Permalink Normal View History

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;
}
}