File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,22 @@ class Solution {
9191};
9292```
9393
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+
94110### ** ...**
95111
96112```
Original file line number Diff line number Diff line change @@ -88,6 +88,22 @@ class Solution {
8888};
8989```
9090
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+
91107### ** ...**
92108
93109```
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