/** * Given two string representations of binary numbers, return a string * representation of their sum. For example: * * "101" * + "11" => badd("101", "11") -> "1000" * ------ * "1000" * * "11" * + "10" => badd("11", "10") -> "101" * ------ * "101" * * "01" * + "10" => badd("01", "10") -> "011" * ------ (leading '0' is optional) * "011" * */ import java.util.Stack; public class computeString{ public String badd(String x, String y) { Stack stack1 = new Stack (); Stack stack2 = new Stack (); Stack stack3 = new Stack (); String z = ""; for(int i=0; i