Загрузка страницы

GOOGLE - SORT CHARACTERS BY FREQUENCY (LeetCode)

Sort Characters By Frequency is one of Google's most commonly asked interview questions according to LeetCode! Give me 5 minutes and you'll thank me if you see this in your interview! Sort Characters By Frequency coding solution and explanation.

DISCORD CHANNEL
----------------------------------------------------------------------------------------------------------------
To join the Discord channel use the following link and join the "Member" tier: https://www.patreon.com/KevinNaughtonJr
In this Discord channel, you will be able to...
1. Ask me questions directly (as well as other members)
2. Ask about and discuss previous interview experiences
3. Find mock interview partners
4. Share helpful videos for interview preparation, and more!

This question is commonly asked by the following companies: Google, LinkedIn, Microsoft, Microsoft, Uber, & Bloomberg.

Link to problem: https://leetcode.com/problems/sort-characters-by-frequency/

Intuition behind solution: Populate a hash map counting the occurrence of each character. Populate a max heap by using all the keys inside the hash map. Populate a string builder by continuously removing elements from the max heap and repeating them however many times they appear in the hash map. Return the string builder as a string.

SOCIAL
----------------------------------------------------------------------------------------------------------------
Support me on Patreon: https://www.patreon.com/KevinNaughtonJr
Follow me on Twitter: https://twitter.com/KevinNaughtonJr
Follow me on Instagram: https://www.instagram.com/kevinnaughtonjr/
Follow me on GitHub: https://github.com/kdn251

MUSIC
----------------------------------------------------------------------------------------------------------------
Blushes by Dj Quads
https://soundcloud.com/aka-dj-quads/blushes

#coding #interviews #softwareengineering

Видео GOOGLE - SORT CHARACTERS BY FREQUENCY (LeetCode) канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
28 февраля 2019 г. 5:00:44
00:06:50
Яндекс.Метрика