class UncommonLetterMap {

    public String getMinifiedWord(String word) {
        Queue<LetterFreqPair> mostInfreq = new LinkedList<LetterFreqPair>();
        PriorityQueue<LetterFreqPair> infreqHeap = new PriorityQueue<LetterFreqPair>();
        for (char letter : word.toCharArray()) {
            letter = this.sofitMap.containsKey(letter) ? this.sofitMap.get(letter) : letter;
            int ind = letter_freq_list.indexOf(letter);
            if (ind != -1) {
                if (infreqHeap.size() <= this.len_min_word || ind > infreqHeap.peek().freq) {
                    LetterFreqPair lfp = new LetterFreqPair(letter, ind);
                    mostInfreq.add(lfp);
                    infreqHeap.add(lfp);
                }
                if (mostInfreq.size() > this.len_min_word) {
                    mostInfreq.remove(infreqHeap.poll());
                }
            }
        }

        String out = "";
        for (LetterFreqPair lfp : mostInfreq) {
            out += lfp.getLetter();
        }

        return out;
    }

    public  UncommonLetterMap(int len_min_word);

}