My Simple Java Solution


  • 1
    Y
    import java.math.BigInteger;
    
    public class Solution {
        public String addBinary(String a, String b) {
            return (new BigInteger(a, 2)).add(new BigInteger(b, 2)).toString(2);
        }
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.