We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a16de33 commit b78f8afCopy full SHA for b78f8af
src/leetcode/string/add-binary.ts
@@ -1,7 +1,7 @@
1
export function addBinary(a: string, b: string): string {
2
if (a.length == 0) return b
3
if (b.length == 0) return a
4
- if (a.length && b.length == 0) return '0'
+ if (a.length == 0 && b.length == 0) return '0'
5
let sum = ''
6
let carry = 0
7
// 1010
0 commit comments