일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 알고리즘
- 머신러닝
- Algorithm
- 유니티
- 디자인
- 팩토리
- ML Agent
- 개발
- LeetCode
- 문제풀이
- 강의
- 인공지능
- 길 찾기
- AI
- 디자인 패턴
- Unity
- GetComponet
- desgin
- 2번
- Design
- 게임
- A*
- JPS
- Factory
- 프로그래밍
- 디자인패턴
- C++
- pattern
- 패턴
- 성능
Archives
- Today
- Total
목록Median of Two Sorted Arrays (1)
Game Development

문제 링크 Example 1: Input: nums1 = [1,3], nums2 = [2] Output: 2.00000 Explanation: merged array = [1,2,3] and median is 2. Example 2: Input: nums1 = [1,2], nums2 = [3,4] Output: 2.50000 Explanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5. 풀이 두 배열을 하나의 배열로 합친 후 해당 배열에서 가장 중간 값을 찾아주면 됩니다. 여기서 배열의 크기가 짝수일 경우에는 중간의 2개 값을 더하고 절반의 값을 출력해주면 됩니다. class Solution { public: double findMedian..
Algorithms/Leet Code
2023. 9. 23. 16:40