Skip to content

Commit 35532f6

Browse files
authored
Merge pull request #1532 from ivanpenaloza/january30
adding algo
2 parents c06b614 + 73eec5d commit 35532f6

16 files changed

Lines changed: 9 additions & 387 deletions

src/my_project/interviews/amazon_high_frequency_23/common_algos/two_sum_round_1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def twoSum(self, nums: List[int], target: int) -> List[int]:
1010

1111
if v in answer:
1212
return [answer[v], k]
13-
else:
13+
else:
1414
answer[target - v] = k
15-
15+
1616
return []

src/my_project/interviews/amazon_high_frequency_23/common_algos/two_sum_round_2.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/my_project/interviews/amazon_high_frequency_23/common_algos/two_sum_round_3.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/my_project/interviews/amazon_high_frequency_23/common_algos/two_sum_round_4.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/my_project/interviews/amazon_high_frequency_23/common_algos/valid_palindrome_round_1.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ def isPalindrome(self, s: str) -> bool:
1111
# Remove non-alphanumeric characters
1212
s = re.sub(pattern=r'[^a-zA-Z0-9]', repl='', string=s)
1313

14-
# Determine if s is palindrome or not
14+
# Determine if it is palindrome or not
15+
1516
len_s = len(s)
1617

1718
for i in range(len_s//2):
18-
19+
1920
if s[i] != s[len_s - 1 - i]:
2021
return False
2122

src/my_project/interviews/amazon_high_frequency_23/common_algos/valid_palindrome_round_2.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/my_project/interviews/amazon_high_frequency_23/common_algos/valid_palindrome_round_3.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/my_project/interviews/amazon_high_frequency_23/common_algos/valid_palindrome_round_4.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/my_project/interviews/amazon_high_frequency_23/round_5/design_sql.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from typing import List, Union, Collection, Mapping, Optional, Dict
22

3+
34
class Table:
45

56
def __init__(self, name:str, columns: int, rows: Dict, row_count: int = 0):
@@ -98,8 +99,6 @@ def exp(self, name: str) -> List[str]:
9899
result.append(f"{row_id},{row_str}")
99100

100101
return result
101-
102-
103102

104103

105104

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Union, Collection, Mapping, Optional
1+
from typing import List, Union, Collection, Mapping, Optional, Dict
22
from abc import ABC, abstractmethod
33
import math
44

@@ -8,7 +8,5 @@ def minimumTime(self, jobs: List[int], workers: List[int]) -> int:
88
jobs.sort()
99
workers.sort()
1010

11-
return max([math.ceil(n/d) for n,d in zip(jobs, workers)])
12-
13-
14-
11+
return max([math.ceil(n/d) for n, d in zip(jobs, workers)])
12+

0 commit comments

Comments
 (0)