python 3 || O(n)/O(1) || without priority queue
```\nclass Solution:\n    def repeatLimitedString(self, s: str, repeatLimit: int) -> str:\n        count = collections.Counter(s)\n        chrs = list(map(list,
```\nclass Solution:\n    def repeatLimitedString(self, s: str, repeatLimit: int) -> str:\n        count = collections.Counter(s)\n        chrs = list(map(list, sorted(count.items(), reverse=True)))\n        res = []\n        first, second = 0, 1\n        n = len(chrs)\n        \n        while second < n:\n            if chrs[first][1] <= repeatLimit:\n                res.append(chrs[first][0] * chrs[first][1])\n                first += 1\n                while chrs[first][1] == 0:\n                    first += 1\n                if first >= second:\n                    second = first + 1\n            else:\n                res.append(chrs[first][0] * repeatLimit + chrs[second][0])\n                chrs[first][1] -= repeatLimit\n                chrs[second][1] -= 1\n                if chrs[second][1] == 0:\n                    second += 1\n        \n        res.append(chrs[first][0] * min(repeatLimit, chrs[first][1]))\n        return \'\'.join(res)
['Greedy', 'Python', 'Python3']