File tree 3 files changed +43
-0
lines changed
solution/2500-2599/2568.Minimum Impossible OR
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,22 @@ func minImpossibleOR(nums []int) int {
114
114
}
115
115
```
116
116
117
+ ### ** TypeScript**
118
+
119
+ ``` ts
120
+ function minImpossibleOR(nums : number []): number {
121
+ const s: Set <number > = new Set ();
122
+ for (const x of nums ) {
123
+ s .add (x );
124
+ }
125
+ for (let i = 0 ; ; ++ i ) {
126
+ if (! s .has (1 << i )) {
127
+ return 1 << i ;
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
117
133
### ** ...**
118
134
119
135
```
Original file line number Diff line number Diff line change @@ -98,6 +98,22 @@ func minImpossibleOR(nums []int) int {
98
98
}
99
99
```
100
100
101
+ ### ** TypeScript**
102
+
103
+ ``` ts
104
+ function minImpossibleOR(nums : number []): number {
105
+ const s: Set <number > = new Set ();
106
+ for (const x of nums ) {
107
+ s .add (x );
108
+ }
109
+ for (let i = 0 ; ; ++ i ) {
110
+ if (! s .has (1 << i )) {
111
+ return 1 << i ;
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
101
117
### ** ...**
102
118
103
119
```
Original file line number Diff line number Diff line change
1
+ function minImpossibleOR ( nums : number [ ] ) : number {
2
+ const s : Set < number > = new Set ( ) ;
3
+ for ( const x of nums ) {
4
+ s . add ( x ) ;
5
+ }
6
+ for ( let i = 0 ; ; ++ i ) {
7
+ if ( ! s . has ( 1 << i ) ) {
8
+ return 1 << i ;
9
+ }
10
+ }
11
+ }
You can’t perform that action at this time.
0 commit comments