Javascript || Using hashmap || 🔥🔥Faster than 100.00% 🔥🔥
Code explanation\n Create two maps each for upper and lower case letters and store the frequency of respective characters with index as their relative position 
**Code explanation**\n* Create two maps each for upper and lower case letters and store the frequency of respective characters with index as their relative position with respect to the first letter.\nso \'a\' or \'A\' wil become 0, I will be \'4\' and all of the other letters will have a default frequency of 0, which is not hsown below for better readability.\n  example: Input: s = "lEeTcOdE"\n   ```\n\tuc=\n\t{\n\t\t\'4\': 2,\n\t\t\'14\': 1,\n\t\t\'19\': 1,\n\t} \n\t\n\tlc =\n\t{\n\t\t\'2\': 1,\n\t\t\'3\': 1,\n\t\t\'4\': 1,\n\t\t\'11\': 1,\n\t}\n\t```\n* \tNow we know that we have these maps having frequency of each character and will have 26 keys. \n* \tWe will run a loop 26 times to account each of the keys and check if a particular letter is present in both of the maps. \n* \tLet\'s say in `lEeTcOdE` we will start looking for `z or Z` first as we will start from `25th` position and see in the uc and lc map but in our case frequency for both `z` and `Z` is 0. So will move forward.\n* \t But in the case of position value 4 which corresponds to `e` in lc and `E` in uc have frequency greater than 0. then we found first such character, so now we will convert the position `4` to corresponsing character un Uppercase which `E` for that we will use `String.fromCharCode(\'A\'.charCodeAt(0) + i)` here we are adding the character code of `A` to the position value and then coverst this to charecter using the `String.fromCharCode` method\n\n* \tThe benefit of looking from backward is we will encounter the greater character first else we had to take care of this seprately and we had to loop more to get the result.  According  to the question  "**An English letter b is greater than another letter a if b appears after a in the English alphabet"**. That is why looking from back(z) will give the result with the greater letter first and we will exit from the loop immediately.\n```\nvar greatestLetter = function (s) {\n  let uc = { ...Array(26).fill(0) }, lc = { ...Array(26).fill(0) };\n  for (let ch of s)\n    if (isUpper(ch))\n      ++uc[asciiDif(ch, "A")];\n    else\n      ++lc[asciiDif(ch, "a")];\n  for (let i = 25; i >= 0; --i) { // iterating from back to get the greater letter\n    if (uc[i] && lc[i]) return String.fromCharCode(\'A\'.charCodeAt(0) + i);\n  }\n  return "";\n};\n\nconst isUpper = (char) => char.toUpperCase() === char;\nconst asciiDif = (a, b) => a.charCodeAt(0) - b.charCodeAt(0);\n```
['String', 'JavaScript']