Problem List

Add Binary

January 28, 2025Go math, string, bit manipulation, simulation

Go Solution
func addBinary(a string, b string) string {
  num1:= new (big.Int)
  num2:= new (big.Int)
  num1.SetString(a, 2)
  num2.SetString(b, 2)

  sum:= new (big.Int).Add(num1, num2)

  return sum.Text(2)
}
LeetCode Problem Link