LeetCode #26: Remove Duplicates From a Sorted Array

preview_player
Показать описание
A step-by-step solution to #LeetCode question 26: Remove Duplicates From a Sorted Array
0:00 Problem description
0:48 Strategy using pop()
1:29 Optimized strategy

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

The brilliance and clarity of this guy is unrivaled. Thank you!

jpkeys
Автор

although it was easy i was scratching my head to understand it you made me understand it in 2 mins amazing man!

karimmerhi
Автор

Great video and explanation, it's easy to understand and follow. Thank you and I look forward to more of your videos!:)

SophieD-ys
Автор

Could you please solve more Leetcode top interview problems(Easy and Medium) and upload them? Your way of explanation is easy to understand and helpful...

AnushaD-hh
Автор

It's cursed, but:

nums = list(set(nums))
return len(nums)

We all both hate and love python. I wouldn't even be surprised if this was even faster than the algorithm.

Jetpans
Автор

def removeDuplicates(self, nums):
unique_num = []
for current_num in nums:
if current_num not in unique_num:


nums = unique_num
return len(nums)

^^^ it would be much easier in this way but LeetCode just don't accept it !

Hugo_Youtube