File tree 3 files changed +43
-0
lines changed
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,22 @@ class Solution {
91
91
};
92
92
```
93
93
94
+ ### ** Go**
95
+
96
+ ``` go
97
+ func isUnique (astr string ) bool {
98
+ bitmap := 0
99
+ for _ , r := range astr {
100
+ pos := r - ' a'
101
+ if (bitmap & (1 << pos)) != 0 {
102
+ return false
103
+ }
104
+ bitmap |= (1 << pos)
105
+ }
106
+ return true
107
+ }
108
+ ```
109
+
94
110
### ** ...**
95
111
96
112
```
Original file line number Diff line number Diff line change @@ -88,6 +88,22 @@ class Solution {
88
88
};
89
89
```
90
90
91
+ ### ** Go**
92
+
93
+ ``` go
94
+ func isUnique (astr string ) bool {
95
+ bitmap := 0
96
+ for _ , r := range astr {
97
+ pos := r - ' a'
98
+ if (bitmap & (1 << pos)) != 0 {
99
+ return false
100
+ }
101
+ bitmap |= (1 << pos)
102
+ }
103
+ return true
104
+ }
105
+ ```
106
+
91
107
### ** ...**
92
108
93
109
```
Original file line number Diff line number Diff line change
1
+ func isUnique (astr string ) bool {
2
+ bitmap := 0
3
+ for _ , r := range astr {
4
+ pos := r - 'a'
5
+ if (bitmap & (1 << pos )) != 0 {
6
+ return false
7
+ }
8
+ bitmap |= (1 << pos )
9
+ }
10
+ return true
11
+ }
You can’t perform that action at this time.
0 commit comments