✅ JavaScript Solution || Simple & Understandable
JavaScript code:\n\nvar greatestLetter = function(s) {\n    let sorted = s.split("").sort();\n    let i = sorted.length-1\n    console.log(i)\n    while (i>=0 &
JavaScript code:\n```\nvar greatestLetter = function(s) {\n    let sorted = s.split("").sort();\n    let i = sorted.length-1\n    console.log(i)\n    while (i>=0 && sorted[i].toLowerCase()==sorted[i]) {\n        let char = sorted[i].toUpperCase()\n        if (sorted.includes(char)) {\n            return char.toString()\n        }\n        console.log(i)\n        i--\n    } return ""\n};\n```
['String', 'JavaScript']