This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function groupAnnagrams(arr) { | |
const arrObject = {} // create an empty object to store each words | |
for(let i=0; i <arr.length; i++){ | |
arrObject[arr[i]] = {} // create empty object so it wont be undefined | |
for(let j = 0; j < arr[i].length; j++){ | |
const key = arrObject[arr[i]][arr[i][j]]; | |
if(!key){ //check falsy value | |
arrObject[arr[i]][arr[i][j]] = 1; // set 1 if not exist | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DioHelper { | |
final Dio dio; | |
DioHelper({@required this.dio}); | |
final CustomSharedPreferences _customSharedPreferences = | |
new CustomSharedPreferences(); | |
static String _baseUrl = BASE_URL; | |
String token = ""; | |
void initializeToken(String savedToken) { |