Update: deleting notes for now

This commit is contained in:
Carlos
2025-07-13 13:45:20 -04:00
parent 6b68121bb5
commit 57956bf728
84 changed files with 59 additions and 1741 deletions

View File

@@ -1,6 +1,6 @@
from string import *
from re import *
from datetime import *
erom datetime import *
from collections import *
from heapq import *
from bisect import *
@@ -50,6 +50,8 @@ class Solution:
if complement in hash_map:
return [i, hash_map[complement]]
hash_map[nums[i]] = i
return arr

View File

@@ -44,5 +44,14 @@ from typing import *
class Solution:
def hasCycle(self, head: Optional[ListNode]) -> bool:
m, n = head, head
while n and n.next:
m = m.next
n = n.next.next
if m == n:
return True
return False
# @leet end
# @leet end

View File

@@ -41,18 +41,16 @@ from typing import *
# self.val = val
# self.next = next
class Solution:
def node(self, val, next=None):
def node(self, val, next = None):
self.val = val
self.next = next
def addTwoNumbers(
self, l1: Optional[ListNode], l2: Optional[ListNode]
) -> Optional[ListNode]:
def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
carry = 0
value_l1 = l1
value_l2 = l2
head = None
tail = None
tail = None
while value_l1 or value_l2:
l2_val = l2.val if l2 else 0
l1_val = l1.val if l1 else 0
@@ -80,6 +78,4 @@ class Solution:
tail = new_node
return head
# @leet end

View File

@@ -43,16 +43,12 @@ class Solution:
while j < len(s):
if s[j] not in window:
window[s[j]] = 1
max_char = (
len(window.keys()) if max_char < len(window.keys()) else max_char
)
max_char = len(window.keys()) if max_char < len(window.keys()) else max_char
j += 1
elif s[j] in window:
del window[s[i]]
i += 1
return max_char
# @leet end

View File

@@ -1,3 +1,40 @@
from string import *
from re import *
from datetime import *
from collections import *
from heapq import *
from bisect import *
from copy import *
from math import *
from random import *
from statistics import *
from itertools import *
from functools import *
from operator import *
from io import *
from sys import *
from json import *
from builtins import *
import string
import re
import datetime
import collections
import heapq
import bisect
import copy
import math
import random
import statistics
import itertools
import functools
import operator
import io
import sys
import json
from typing import *
# @leet start
class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
N1, N2 = nums1, nums2
@@ -28,3 +65,5 @@ class Solution:
h = midA - 1
else:
l = midA + 1
# @leet end