Scala | 1 Liner
This is why I love Scala\n\n\nobject Solution {\n  def greatestLetter(s: String): String = s.groupBy(c => if (c >= \'a\') c - \'a\' else c - \'A\')\n    .filter
This is why I love Scala\n\n```\nobject Solution {\n  def greatestLetter(s: String): String = s.groupBy(c => if (c >= \'a\') c - \'a\' else c - \'A\')\n    .filter(_._2.distinct.length > 1)\n    .toSeq.sortBy(_._1)(Ordering.Int.reverse)\n    .headOption.map(_._2.sorted.head.toString)\n    .getOrElse("")\n}\n```\n\nEven better\n```\nobject Solution {\n  def greatestLetter(s: String): String = (\'Z\'.toInt to \'A\'.toInt by -1).map(_.toChar)\n\t.filter(c => s.contains(c) && s.contains(c.toLower))\n\t.headOption.map(_.toString).getOrElse("")\n}\n```
['Scala']