Java | runtime 1ms | easy solution with comments
class Solution {\n    public String greatestLetter(String s) {\n        \n        char c=\'z\', C=\'Z\';\n        \n        for(int i=0; i<26; i++){\n          
class Solution {\n    public String greatestLetter(String s) {\n        \n        char c=\'z\', C=\'Z\';\n        \n        for(int i=0; i<26; i++){\n            // check if both upper and lowercase of the character exist\n            // if it does return the character else decrement the character\n            // by one\n            if(s.indexOf(c)!=-1 && s.indexOf(C)!=-1)\n                return ""+C;\n            else{\n                c--;\n                C--;\n            }\n        }\n        \n        return "";\n        \n    }\n}
['Java']