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

GOOGLE CODING INTERVIEW QUESTION - SHORTEST WAY TO FORM STRING

SOCIAL
----------------------------------------------------------------------------------------------------------------
Instagram: https://instagram.com/kevinnaughtonjr/
Twitter: https://twitter.com/KevinNaughtonJr
Patreon: https://www.patreon.com/KevinNaughtonJr
Merch: https://teespring.com/stores/kevin-naughton-jrs-store
GitHub: https://github.com/kdn251

This is one of Google's most commonly asked interview questions according to LeetCode (2020)! Google coding interview question shortest way to form string coding solution. If you give me 5 minutes you'll thank me if this appears during your Google interview! Coding Interviews shortest way to form string (LeetCode) question 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

Link to problem: https://leetcode.com/problems/shortest-way-to-form-string/

Intuition behind solution: Iterate through the remaining characters you need to form the target while you have remaining characters. Every time you enter this loop begin forming a subsequence. Using two pointers i and j (i to iterate through source and j to iterate through remaining) append the jth character in remaining to your subsequence if the ith character in source is equal to the jth character in remaining. Once your inner loop terminates, return -1 if your subsequence is length 0. Otherwise, increment the number of subsequences you've used and reassign remaining to it's to the remaining characters you need.

MUSIC
----------------------------------------------------------------------------------------------------------------
xo bored llif3 by young frontwood
https://soundcloud.com/youngfrontwood/xo-bored-lif3

#techinterviews #leetcode #googleinterview

Видео GOOGLE CODING INTERVIEW QUESTION - SHORTEST WAY TO FORM STRING канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Введите заголовок:

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

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

Зарегистрируйтесь или войдите с
Информация о видео
19 марта 2020 г. 6:38:37
00:11:25
Яндекс.Метрика