Find Friends & Solve LeetCode at FriendZone Discord

Summary

FriendZone | Make Friends & Chat ⋅ Active Social Fun ⋅ Chill ⋅ VC is the perfect place to connect with others. This announcement highlights the community's vibrant mix of social interaction and technical collaboration, featuring members who enjoy solving complex LeetCode problems together. Join us to find new friends, engage in active discussions, and participate in coding challenges in a fun, chill environment.

sageranger-10 OP

Im tryna find new friends
18m looking for everyone
Down for everything
Try not to be boring
No bots
Im bored so pls dm

@sageranger-10 Im tryna find new friends 18m looking for everyone Down for everything Try not to be boring No bots…
goldencanyon-95

down for some HARD leetcode questions?

@goldencanyon-95 down for some HARD leetcode questions?
sageranger-10 OP

no

@sageranger-10 no
goldencanyon-95

"Down for everything" ur words not mine

luckycipher-27

you drive him crazy, lol

@luckycipher-27 you drive him crazy, lol
goldencanyon-95

i can do that to u too

luckycipher-27

try bro

@goldencanyon-95 "Down for everything" ur words not mine
sageranger-10 OP

true lol

@luckycipher-27 try bro
goldencanyon-95

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

The overall run time complexity should be O(log (m+n))

luckycipher-27

damn, i am a professional programmer

luckycipher-27

i can do that in mins.

goldencanyon-95

do it

luckycipher-27

man

luckycipher-27

it's not easy

luckycipher-27

😵‍💫

luckycipher-27

share your leetcode profile or anything like that, bro!

@luckycipher-27 share your leetcode profile or anything like that, bro!
goldencanyon-95

what will i get in return?

luckycipher-27

my attention

luckycipher-27

💪

@luckycipher-27 my attention
goldencanyon-95

ive got plenty from others : )

luckycipher-27

you will have 1 foolish guy as your friend

happyquiver-23

def findMedianSortedArrays(nums1, nums2):
# Always binary-search the smaller array
if len(nums1) > len(nums2):
nums1, nums2 = nums2, nums1

m, n = len(nums1), len(nums2)

left, right = 0, m
half = (m + n + 1) // 2

while left <= right:
    i = (left + right) // 2
    j = half - i

    # Boundary values
    Aleft  = nums1[i - 1] if i > 0 else float("-inf")
    Aright = nums1[i] if i < m else float("inf")

    Bleft  = nums2[j - 1] if j > 0 else float("-inf")
    Bright = nums2[j] if j < n else float("inf")

    # Correct partition
    if Aleft <= Bright and Bleft <= Aright:

        if (m + n) % 2 == 1:
            return max(Aleft, Bleft)

        return (max(Aleft, Bleft) + min(Aright, Bright)) / 2

    # Too far right in nums1
    elif Aleft > Bright:
        right = i - 1

    # Too far left in nums1
    else:
        left = i + 1
happyquiver-23

I'm back

luckycipher-27

you got my attention

luckycipher-27

lol

happyquiver-23

Tnks

@happyquiver-23 def findMedianSortedArrays(nums1, nums2): # Always binary-search the smaller array if len(nums1) >…
goldencanyon-95

larper alert

luckycipher-27

you must be senior in log(n+m)

@luckycipher-27 you must be senior in log(n+m)
goldencanyon-95

u bet

luckycipher-27

I am a genius

luckycipher-27

and it took some time for you to solve that log(n+m) problem at the first place.

luckycipher-27

and use that to test someone cuz the problem is short.

@luckycipher-27 and use that to test someone cuz the problem is short.
goldencanyon-95

bruh send me ur lc profile

goldencanyon-95

ill refer u

luckycipher-27

i am not active on it.

luckycipher-27

haven't been solving it for years

goldencanyon-95

what about projects?

luckycipher-27

??

goldencanyon-95

have u built any projects? how old r u?

luckycipher-27

haha

luckycipher-27

take it easy bro

@goldencanyon-95 have u built any projects? how old r u?
happyquiver-23

He's my small bro

@happyquiver-23 He's my small bro
goldencanyon-95

uhhh

@goldencanyon-95 uhhh
happyquiver-23

Who r uuu

happyquiver-23

Colorful?

@happyquiver-23 Colorful?
goldencanyon-95

kiddo

@goldencanyon-95 kiddo
happyquiver-23

Animal

@happyquiver-23 Animal
goldencanyon-95

👍

luckycipher-27

🤣

@goldencanyon-95 👍
happyquiver-23

Any Gender?

The latest from FriendZone | Make Friends & Chat ⋅ Active Social Fun ⋅ Chill ⋅ VC