본문 바로가기

LeetCode41

[LeetCode] 240. Search a 2D Matrix II 문제 URL : https://leetcode.com/problems/search-a-2d-matrix-ii/ Search a 2D Matrix II - LeetCode Can you solve this real interview question? Search a 2D Matrix II - Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: * Integers in each row are sorted in ascending fr leetcode.com 문제 접근법: 배열안에 타겟이 존재하는지 구하는문제입니다. .. 2023. 9. 6.
[LeetCode] 223. Rectangle Area 문제 URL : https://leetcode.com/problems/rectangle-area/ Rectangle Area - LeetCode Can you solve this real interview question? Rectangle Area - Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles. The first rectangle is defined by its bottom-left corner (ax1, ay1) and its leetcode.com 문제 접근법 : 좌상단 우하단 의 좌표로 사각형을 만들어 2개의 사각형이 주어졌을때 .. 2023. 9. 6.
[LeetCode] 30. Substring with Concatenation of All Words 문제 URL : https://leetcode.com/problems/substring-with-concatenation-of-all-words/ Substring with Concatenation of All Words - LeetCode Can you solve this real interview question? Substring with Concatenation of All Words - You are given a string s and an array of strings words. All the strings of words are of the same length. A concatenated substring in s is a substring that contains all leetcod.. 2023. 9. 5.
[LeetCode] 18. 4Sum 문제 URL : https://leetcode.com/problems/4sum/ 4Sum - LeetCode Can you solve this real interview question? 4Sum - Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that: * 0 = i+3; j--){ int l = i + 1; int r = j-1; long long sum = nums[i] + nums[j]; while (l < r) { long long sum2 = sum + nums[l] + nums[r]; if (sum2 2023. 9. 5.