additional data structures
The solution for “additional data structures” can be found here. The following code will assist you in solving the problem.
public static boolean isUniqueChars(String str) {
long checker1 = 0;
long checker2 = 0;
long checker3 = 0;
long checker4 = 0;
for (int i = 0; i < str.length(); ++i) {
int val = str.charAt(i);
int toCheck = val / 64;
val %= 64;
switch (toCheck) {
case 0:
if ((checker1 & (1L << val)) > 0) {
return false;
}
checker1 |= (1L << val);
break;
case 1:
if ((checker2 & (1L << val)) > 0) {
return false;
}
checker2 |= (1L << val);
break;
case 2:
if ((checker3 & (1L << val)) > 0) {
return false;
}
checker3 |= (1L << val);
break;
case 3:
if ((checker4 & (1L << val)) > 0) {
return false;
}
checker4 |= (1L << val);
break;
}
}
return true;
}
More questions on [categories-list]
- tss from gene granges
- ixl ansers ixl ansers
- get coin prices node-binance
- how to setup netflix workflow worker
- spritesheets in pyqt spritesheets in pyqt
- cahokia mounds pictures cahokia mounds pictures cahokia mounds pictures
- python 2 decimal places how to get decimal part of a double in python set number of decimals python
- how to find nuber of tweets per day using python how to find nuber of tweets per day using python how to find nuber of tweets per day using python how to find nuber of tweets per day using python how to find nuber of tweets per day using python
- haskell get specific elements of a String
- vb net code snippets for storing password
- error TS2307: Cannot find module ‘@ngx-meta/core’.
- inline scripts encapsulated in tags