Skip to content

Commit 90af2af

Browse files
committed
remove unused code
1 parent cc2703d commit 90af2af

File tree

69 files changed

+4
-361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4
-361
lines changed

Python/01-matrix.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
import collections
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
class Solution(object):
138
def updateMatrix(self, matrix):

Python/1-bit-and-2-bit-characters.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def isOneBitCharacter(self, bits):

Python/132-pattern.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(n)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def find132pattern(self, nums):

Python/24-game.py

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
from operator import add, sub, mul, truediv
55
from fractions import Fraction
66

7-
try:
8-
xrange # Python 2
9-
except NameError:
10-
xrange = range # Python 3
11-
127

138
class Solution(object):
149
def judgePoint24(self, nums):

Python/4-keys-keyboard.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(1)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def maxA(self, N):

Python/4sum.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
import collections
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
# Two pointer solution. (1356ms)
138
class Solution(object):

Python/accounts-merge.py

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44

55
import collections
66

7-
try:
8-
xrange # Python 2
9-
except NameError:
10-
xrange = range # Python 3
11-
127

138
class UnionFind(object):
149
def __init__(self):

Python/add-binary.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution:
116
# @param a, a string

Python/add-bold-tag-in-string.py

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
import collections
55
import functools
66

7-
try:
8-
xrange # Python 2
9-
except NameError:
10-
xrange = range # Python 3
11-
127

138
# 59ms
149
class Solution(object):

Python/additive-number.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n^3)
22
# Space: O(n)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def isAdditiveNumber(self, num):

Python/alien-dictionary.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
import collections
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
# BFS solution.
138
class Solution(object):

Python/all-nodes-distance-k-in-binary-tree.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
import collections
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
class Solution(object):
138
def distanceK(self, root, target, K):

Python/ambiguous-coordinates.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
import itertools
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
class Solution(object):
138
def ambiguousCoordinates(self, S):

Python/android-unlock-patterns.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(9^2 * 2^9)
22
# Space: O(9 * 2^9)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
# DP solution.
116
class Solution(object):

Python/arithmetic-slices-ii-subsequence.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
import collections
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
class Solution(object):
138
def numberOfArithmeticSlices(self, A):

Python/array-partition-i.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(r), r is the range size of the integers
22
# Space: O(r)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def arrayPairSum(self, nums):

Python/assign-cookies.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(nlogn)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def findContentChildren(self, g, s):

Python/asteroid-collision.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(n)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def asteroidCollision(self, asteroids):

Python/average-of-levels-in-binary-tree.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(h)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def averageOfLevels(self, root):

Python/backspace-string-compare.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
import itertools
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
class Solution(object):
138
def backspaceCompare(self, S, T):

Python/basic-calculator-ii.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(n)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution:
116
# @param {string} s

Python/basic-calculator-iii.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(n)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def calculate(self, s):

Python/basic-calculator-iv.py

-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
import collections
1010
import itertools
1111

12-
try:
13-
xrange # Python 2
14-
except NameError:
15-
xrange = range # Python 3
16-
1712

1813
class Poly(collections.Counter):
1914
def __init__(self, expr=None):

Python/basic-calculator.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(n)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution:
116
# @param {string} s

Python/battleships-in-a-board.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(m * n)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def countBattleships(self, board):

Python/beautiful-arrangement.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n!)
22
# Space: O(n)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def countArrangement(self, N):

Python/best-meeting-point.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
from random import randint
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
class Solution(object):
138
def minTotalDistance(self, grid):

Python/best-time-to-buy-and-sell-stock-ii.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution:
116
# @param prices, a list of integer

Python/best-time-to-buy-and-sell-stock-iii.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
# @param prices, a list of integer

Python/best-time-to-buy-and-sell-stock-iv.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(k * n)
22
# Space: O(k)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
# @return an integer as the maximum profit

Python/best-time-to-buy-and-sell-stock-with-cooldown.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def maxProfit(self, prices):

Python/best-time-to-buy-and-sell-stock-with-transaction-fee.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Time: O(n)
22
# Space: O(1)
33

4-
try:
5-
xrange # Python 2
6-
except NameError:
7-
xrange = range # Python 3
8-
94

105
class Solution(object):
116
def maxProfit(self, prices, fee):

Python/binary-tree-vertical-order-traversal.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
import collections
55

6-
try:
7-
xrange # Python 2
8-
except NameError:
9-
xrange = range # Python 3
10-
116

127
# BFS + hash solution.
138
class Solution(object):

0 commit comments

Comments
 (0)