#Leetcode 86. #Partition List

preview_player
Показать описание
iven the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.

You should preserve the original relative order of the nodes in each of the two partitions.



Example 1:

Input: head = [1,4,3,2,5,2], x = 3
Output: [1,2,2,4,3,5]
Example 2:

Input: head = [2,1], x = 2
Output: [1,2]

Рекомендации по теме
Комментарии
Автор

it was awesome I was surprised 😮😮😮 how you have explained you nailed it Alisha 😮😮😮

jedex
Автор

Even though your handwriting is bad, your way of explaining things is awesome. It was nicely explained, and explanation is easy to grasp.

divyagupta
Автор

Thanks for the explanation and code is also easy !!😄

surajnetha
Автор

keep going alisha i hope you are achieved more

paraschauhan
Автор

hope you'll post videos frequently!! And also if possible, why don't you post many other tricky medium - hard questions.

chaitanyanimma
Автор

Could you please guide me which lang to choose for leetcode, i have learned java but mostly people use c++.??why is that

Star_Bawa
Автор

can't it be done w/o creating the other list i.e in O(1) space

shivamagarawal
Автор

hey thanks for posting this great video, very nicely explained
videos of Code with Alisha never disappoints

Yash-fhgm
join shbcf.ru