• Skip to primary navigation
  • Skip to content
  • Skip to footer
shawn blog
  • Home
  • Category

    shawn

    • South Korea
    • Email
    • GitHub
    • 📂 전체 글 수 215 개
    • Coding Test
      • 프로그래머스 (95)
      • LeetCode (105)
      Python
      • Python (6)
      Git & GitHub
      • Git & GitHub (4)
      etc
      • CSS (2)
      • HTTP (2)

    [LeetCode] 4. Median of Two Sorted Arrays

    최대 1 분 소요

    목차

    • Python

    Python

    class Solution:
        def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
            nums = nums1 + nums2
            nums.sort()
            
            if len(nums) % 2 == 0:
                return (nums[len(nums) // 2] + nums[len(nums) // 2 - 1]) / 2
            else:
                return nums[len(nums) // 2]
    

    태그: Blog, LeetCode

    카테고리: LeetCode

    업데이트: June 30, 2022

    공유하기

    Twitter Facebook LinkedIn
    이전 다음

    댓글남기기

    참고

    [Programmers] 점프와 순간 이동

    최대 1 분 소요

    Python

    [Programmers] 옹알이 (2)

    최대 1 분 소요

    Python

    [Programmers] 명예의 전당 (1)

    최대 1 분 소요

    Python

    [Programmers] 둘만의 암호

    최대 1 분 소요

    Python

    • 팔로우:
    • GitHub
    • 피드
    © 2024 shawn. Powered by Jekyll & Minimal Mistakes.