We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ef2460 commit 860084eCopy full SHA for 860084e
src/easy/BitwiseTwo.go
@@ -0,0 +1,29 @@
1
+package main
2
+
3
+import "fmt"
4
5
+func BitwiseTwo(arr []string) string {
6
+ s1 := arr[0]
7
+ s2 := arr[1]
8
9
+ result := ""
10
11
+ for i := 0; i < len(s1); i++ {
12
+ if string(s1[i]) == "1" && string(s2[i]) == "1" {
13
+ result += string("1")
14
+ } else {
15
+ result += string("0")
16
+ }
17
18
19
+ return result
20
+}
21
22
+func main() {
23
24
+ // Test cases
25
+ result1 := BitwiseTwo([]string{"010111", "101101"})
26
+ fmt.Println(result1)
27
+ result2 := BitwiseTwo([]string{"110001", "111100"})
28
+ fmt.Println(result2)
29
0 commit comments