Skip to content

Instantly share code, notes, and snippets.

View wanderindev's full-sized avatar

Javier Feliu wanderindev

View GitHub Profile
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
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:
class Solution(object):
def is_valid(self, s):
"""
:type s: str
:rtype: bool
"""
bracket_map = {")": "(", "]": "[", "}": "{"}
stack = []
for bracket in s:
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)
class Solution(object):
def length_of_longest_substring(self, s):
"""
:type s: str
:rtype: int
"""
max_length = 0
chars = set()
left_index = 0
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
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:
import {
navbarTemplate,
earthPageTemplate,
marsPageTemplate,
beyondPageTemplate,
aboutPageTemplate,
footerTemplate,
} from "./templates.js";
import {
apiVersion: v1
kind: Service
metadata:
name: hr-rest
spec:
ports:
- port: 80
targetPort: 5002
selector:
app: hr-rest
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