This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
def is_anagram(self, s, t): | |
""" | |
:type s: str | |
:type t: str | |
:rtype: bool | |
""" | |
if not len(s) == len(t): | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def contains_duplicate(self, nums): | |
""" | |
:type nums: List[int] | |
:rtype: bool | |
""" | |
checked_values = set() | |
for num in nums: | |
if num in checked_values: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
def is_valid(self, s): | |
""" | |
:type s: str | |
:rtype: bool | |
""" | |
bracket_map = {")": "(", "]": "[", "}": "{"} | |
stack = [] | |
for bracket in s: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
class Solution(object): | |
offsets = {"right": (0, 1), "left": (0, -1), "up": (-1, 0), "down": (1, 0)} | |
directions = ["right", "left", "up", "down"] | |
def is_neighbor_in_grid(self, neighbor, grid): | |
return ( | |
neighbor[0] < len(grid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
def length_of_longest_substring(self, s): | |
""" | |
:type s: str | |
:rtype: int | |
""" | |
max_length = 0 | |
chars = set() | |
left_index = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListNode: | |
def __init__(self, val=0, next=None): | |
self.val = val | |
self.next = next | |
class Solution: | |
def add_two_numbers(self, l1, l2): | |
""" | |
:type l1: ListNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def two_sum(self, nums, target): | |
""" | |
:type nums: List[int] | |
:type target: int | |
:rtype: List[int] | |
""" | |
comp = {} | |
for index, num in enumerate(nums): | |
if num in comp: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
navbarTemplate, | |
earthPageTemplate, | |
marsPageTemplate, | |
beyondPageTemplate, | |
aboutPageTemplate, | |
footerTemplate, | |
} from "./templates.js"; | |
import { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: hr-rest | |
spec: | |
ports: | |
- port: 80 | |
targetPort: 5002 | |
selector: | |
app: hr-rest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: cert-manager.io/v1 | |
kind: ClusterIssuer | |
metadata: | |
name: letsencrypt-prod | |
namespace: cert-manager | |
spec: | |
acme: | |
# The ACME server URL | |
server: https://acme-v02.api.letsencrypt.org/directory | |
# Email address used for ACME registration |