Python Algorithms Training Advanced¶
Python Algorithms Training Advanced
- written by sean base on following site
- https://github.com/xuelangZF/LeetCode


Github | https://github.com/newsteinking/High_pythonalgorithms_training_advanced
Chapter 0: About¶
Python Algorithms Advanced Curriculm

Thanks to¶
잠시나마 오픈소스에 대한 희망을 안겨주었던 멤버들에게 감사의 마음을 전합니다.
다들 다른곳에서 각자 열심히 일하는데 모두들 건승하길 바랍니다.
.
- sean
- Mr Ju SS
- OSS Members
SEAN's Paradise¶
I think that My Life as Software Engineer was torrible , but it's role for social is important so, I keep going for better life & software development
chapter 1: Array¶
26. Remove Duplicated From Sorted Array¶
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
Example 1:
Given nums = [1,1,2],
Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively.
It doesn't matter what you leave beyond the returned length. Example 2:
Given nums = [0,0,1,1,1,2,2,3,3,4],
Your function should return length = 5, with the first five elements of nums being modified to 0, 1, 2, 3,
and 4 respectively.
It doesn't matter what values are set beyond the returned length.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
removed_end = 0
for i in range(1, len(nums)):
if nums[i] != nums[removed_end]:
removed_end += 1
nums[removed_end] = nums[i]
return removed_end + 1
"""
[]
[1,1,2,2,3]
[1,3,5,8,9,9,9]
"""
27. Remove Element¶
31. Next Permutation¶
41. First Missing Positive¶
54. Spiral Matrix¶
57. Insert Interval¶
59. Spiral Matrix 2¶
73. Set Matrix Zeroes¶
118. Pascal Triange¶
119. Pascal Triangel 2¶
164. Maximum Gap¶
189. Rotate Array¶
228. Summary Ranges¶
283. Move Zeroes¶
289. Game of Life¶