The difficulty of this question


  • -27
    C

    I think this question is too easy. I wrote it in 5 mins. So, I think the difficulty of it may be easy, not Hard.


  • 0
    M

    I highly doubt you did it right. Feel free to prove me wrong by showing your code.


  • 0
    C

    class Solution(object):
    def findMedianSortedArrays(self, nums1, nums2):
    """
    :type nums1: List[int]
    :type nums2: List[int]
    :rtype: float
    """
    sum_num = sorted(nums1 + nums2)
    n = len(sum_num) / 2
    if len(sum_num) % 2 == 0:
    return (sum_num[n - 1] + sum_num[n]) / 2.0
    else:
    return float(sum_num[n])


  • 0
    M
    1. That's very hard to read. Please format it correctly.
    2. That's obviously not O(log(m+n)). So you indeed didn't do it right.
    3. That took you five minutes? Should take one, maybe two.

  • 1
    X

    You are so mean...


  • 0
    S

    It brave of you to share your solution, thought it's not very satisfactory. But I still give you a up vote, don't feel disappointed for the down votes XD.


  • 0
    C

    Thanks for your source codes though it is not what I want to get.


  • 0

    hahaha
    very interesting


  • 0
    S

    It should be an up vote ...


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.