본문 바로가기

코딩테스트/LeetCode20

[Python][LeetCode] Binary Search(이진탐색) https://leetcode.com/problems/binary-search/description/ Binary Search - LeetCode Can you solve this real interview question? Binary Search - Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1. leetcode.com 문제설명: 정렬된 리스트를 입력받아 이진검색으로 target에 해당하는 인덱스를 구.. 2023. 11. 1.
[Python][LeetCode] Two Sum II (두 수의 합) https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/ Two Sum II - Input Array Is Sorted - LeetCode Can you solve this real interview question? Two Sum II - Input Array Is Sorted - Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two n leetcode.com 문제 설명:.. 2023. 11. 1.
[Python][LeetCode] Search a 2D Matrix II(2D 매트릭스 검색) https://leetcode.com/problems/search-a-2d-matrix-ii/description/ 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 문제 설명: 행렬이 주어졌을때 target의 값을 구하.. 2023. 11. 1.
[Python][leetCode] List Sort(리스트 정렬) https://leetcode.com/problems/sort-list/description/ Sort List - LeetCode Can you solve this real interview question? Sort List - Given the head of a linked list, return the list after sorting it in ascending order. Example 1: [https://assets.leetcode.com/uploads/2020/09/14/sort_list_1.jpg] Input: head = [4,2,1,3] Output: [1, leetcode.com 문제설명 연결 리스트가 주어졌을때 퀵 정렬로 정렬하는 방식으로 구현해보았다. quick sort 방식은.. 2023. 10. 30.