RUVIDEO
Поделитесь видео 🙏

Partition A Linked List: Amazon Interview Problem | LeetCode 86

In this episode, we solve Cracking the Coding Interview Problem Partition List where we are given a target value and asked to partition a linked list around that value. We solve this in O(n) linear runtime and O(1) memory.

Watch and enjoy.

My Other Channel: https://www.youtube.com/channel/UCHdRqpbJU2NRvfsMu1Vg6VQ

Top Software/ Coding Channels:
https://www.youtube.com/channel/UCxX9wt5FWQUAAz4UrysqK9A
https://www.youtube.com/c/KevinNaughtonJr
https://www.youtube.com/channel/UCV0qA-eDDICsRR9rPcnG7tw
https://www.youtube.com/channel/UC4xKdmAXFh4ACyhpiQ_3qBw

Top Python Coding Channels:
https://www.youtube.com/channel/UC_mYaQAE6-71rjSN6CeCA-g
https://www.youtube.com/channel/UCYN7_u5craa4dZc12Ik2P0g

Twitter: https://twitter.com/RealChrisIbe/
Instagram: https://www.instagram.com/christopher_ibe/
Facebook: https://www.facebook.com/christopher.ibeekeocha
Snapchat: @christopheribe
LinkedIn: https://www.linkedin.com/in/christopher-ibe-ekeocha/

Problem Statement:
Partition: Write code to partition a linked list around a value x, such that all nodes less than x come before all nodes greater than or equal to x.

(IMPORTANT: The partition element x can appear anywhere in the “right partition”; if does not need to appear between the left and right partitions. The additional spacing in the example below indicates the partition. Yes, the output below is one of many valid outputs!)
EXAMPLE
Input: 3 - 5 - 8 - 5 - 10 - 2 - 1 [partition=5]
Output: 3 - 1 - 2 - 10 - 5 - 5 - 8

Hint:
There are many solutions to this problem, most of which are equally optimal in runtime. Some have shorter, cleaner code than others. Can you brainstorm different solutions?

Consider the elements don’t have to stay in the same relative order. We only need to ensure that elements less than the pivot must be before elements greater than the pivot. Does that help you come up with more solutions?

LeetCode link: https://leetcode.com/problems/partition-list/

Motivation Quotes:
https://graciousquotes.com/hard-work-quotes/
https://www.birthdaywishes.expert/hard-work-quotes/

Amazon Link: https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850/ref=sr_1_1?crid=IHOW8PLE1N1J&dchild=1&keywords=cracking+the+coding+interview&qid=1621821456&sprefix=cracking+the+%2Caps%2C230&sr=8-1

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Partition A Linked List: Amazon Interview Problem | LeetCode 86», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.