| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- 깃
- greedy
- javascript
- 방송대
- it
- 자바
- dynamic programming
- 그리디
- LeetCode
- 컴퓨터과학과
- 이진탐색
- 리트코드
- 자바스크립트
- Binary Search
- 방송통신대학교
- Git
- algorithm
- DP
- boj
- 투포인터
- 탐욕알고리즘
- 백준
- two pointers
- 코테
- 알고리즘
- 방통대
- sliding window
- java
- 완전탐색
- 코딩
- Today
- Total
목록javascript (25)
개발이 취미인 주니어 기획자
🚀 슬라이딩 윈도우(Sliding Window)란? 배열에서 고정된 크기(윈도우)의 부분집합을 지속적으로 추출하고 처리하는 알고리즘이다. 윈도우라는 고정된 크기의 데이터 스트림에서 계속해서 이동시키면서, 각 윈도우에 대해 일련의 작업을 수행한다. 슬라이딩 윈도우의 시간 복잡도는 O(N)이다. 🔎 슬라이딩 윈도우 이해하기 ❓ 고정된 범위(윈도우) 안에 있는 원소들의 합 중 가장 큰 값을 리턴한다고 가정하자. 1. 최댓값을 저장해 놓을 변수를 하나 만든다 2. 제시된 배열을 돌 범위(윈도우)를 만든다 3. 윈도우 내의 원소들의 합을 도출해 낸다 4. 원소들의 합과 최댓값 변수를 비교해서 원소들의 합이 더 크다면, 최댓값 변수의 값에 원소들의 합을 할당한다. ⏳ 시간 복잡도 O(N) 👩🏻💻 코드 구현(..
#투포인터 #EASY Middle of the Linked List - LeetCode Can you solve this real interview question? Middle of the Linked List - Given the head of a singly linked list, return the middle node of the linked list. If there are two middle nodes, return the second middle node. Example 1: [https://assets.leetcode. leetcode.com 🌷 문제 설명 ✏️ LeetCode 연습문제: Middle of the Linked List Given the head of a singly lin..
#투포인터 #MEDIUM 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 🌷 문제 설명 ✏️ LeetCode 연습문제: Two Sum II - Input Array Is Sorted Given a..
#투포인터 #EASY
#투포인터 #EASY Reverse String - LeetCode Can you solve this real interview question? Reverse String - Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place [https://en.wikipedia.org/wiki/In-place_algo leetcode.com 🌷 문제 설명 ✏️ LeetCode 연습문제: Reverse String Write a function that reverses a string. The inpu..
#투포인터 #EASY Move Zeroes - LeetCode Can you solve this real interview question? Move Zeroes - Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. E leetcode.com 🌷 문제 설명 ✏️ LeetCode 연습문제: Move Zeros Given an integer array nums, move all 0's to the end of it..
🚀 투포인터(Two Pointers)란? 정렬이 되어 있는 자료에서 두 포인터가 가리키는 값이 반환하는 값을 찾아내는 탐색 알고리즘. 타겟 값을 반환하는 한 쌍을 찾을 때까지 이진 검색을 순환적으로 반복 수행하며, 메모리와 시간 절약을 가져온다. 투포인터의 시간 복잡도는 O(N)이다. 🔎 투포인터 이해하기 1. Reverse Pointers ❓오름차순으로 정렬된 배열에서 두 수의 합이 타겟이 되는 값을 탐색해야 하는 상황일 때를 가정한다. 1. 포인터1(처음)과 포인터2(끝)를 정의한다 2. 포인터1과 포인터2의 합과 타겟 값을 비교한다 3-1. 포인터1과 포인터2의 합이 타겟값보다 작으면, 포인터1을 우측(+1)으로 옮긴다 3-2. 포인터1과 포인터2의 합이 타겟값보다 크면, 포인터2를 좌측(-1)으로..
#투포인터 #EASY Squares of a Sorted Array - LeetCode Can you solve this real interview question? Squares of a Sorted Array - Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: Input: nums = [-4,-1,0,3,10] Out leetcode.com 🌷 문제 설명 ✏️ LeetCode 연습문제: Squares of a Sorted Array Given an integer array nums so..
#이진탐색 #EASY Search Insert Position - LeetCode Can you solve this real interview question? Search Insert Position - Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must w leetcode.com 🌷 문제 설명 ✏️ LeetCode 연습문제: Search Insert Position Given a sorted array of distinct i..
#이진탐색 #EASY First Bad Version - LeetCode Can you solve this real interview question? First Bad Version - You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed base leetcode.com 🌷 문제 설명 ✏️ LeetCode 연습문제: First Bad Version You are a product manager and currently lea..