목록2024/03 (38)
넘치게 채우기
https://leetcode.com/problems/subarrays-with-k-different-integers/ Leetcode - Subarrays with K Different Integers 문제 유형 : 슬라이딩 윈도우 / 해시 문제 난이도 : Hard 문제 Given an integer array nums and an integer k, return the number of good subarrays of nums. A good array is an array where the number of different integers in that array is exactly k. For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3..
https://leetcode.com/problems/count-subarrays-where-max-element-appears-at-least-k-times/description/ Leetcode - Count Subarrays Where Max Element Apperas at Least K Times 문제 유형 : 슬라이딩 윈도우 문제 난이도 : Medium 문제 You are given an integer array nums and a positive integer k. Return the number of subarrays where the maximum element of nums appears at least k times in that subarray. A subarray is a cont..
https://school.programmers.co.kr/learn/courses/30/lessons/43163 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 프로그래머스 - 단어 변환 문제 유형 : DFS/BFS 문제 난이도 : Level 3 문제 두 개의 단어 begin, target과 단어의 집합 words가 있습니다. 아래와 같은 규칙을 이용하여 begin에서 target으로 변환하는 가장 짧은 변환 과정을 찾으려고 합니다. 1. 한 번에 한 개의 알파벳만 바꿀 수 있습니다. 2. words에 있는 단어로만 변환할 수 있습니다. 예를 들어 beg..
https://leetcode.com/problems/length-of-longest-subarray-with-at-most-k-frequency/description/ Leetcode - Length of Longest Subarray With at Most K Frequency 문제 유형 : 슬라이딩 윈도우, 해시 문제 난이도 : Medium 문제 You are given an integer array nums and an integer k. The frequency of an element x is the number of times it occurs in an array. An array is called good if the frequency of each element in this array..
https://leetcode.com/problems/subarray-product-less-than-k/description/ Leetcode - Subarray Product Less Than K 문제 유형 : 슬라이딩 윈도우 문제 난이도 : Medium 문제 Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly less than k. 정수 배열 nums와 정수 k가 주어진다. 전체 곱이 k보다 작은 부분배열들의 개수를 구하시오. 풀이 슬라이딩 윈도우를 이용하여 풀어주면 된다..
https://leetcode.com/problems/first-missing-positive/description/ Leetcode - First Missing Positive 문제 유형 : 배열, 정렬 문제 난이도 : Hard 문제 Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums. You must implement an algorithm that runs in O(n) time and uses O(1) auxiliary space. 정렬되지 않은 정수 배열 nums가 주어집니다. nums에 없는 가장 작은 자연수를 반환하시오. 알고리즘을 O(n)의 시간과 O(1)의 ..
https://leetcode.com/problems/find-all-duplicates-in-an-array/description/ Leetcode - Find All Duplicaties in an Array 문제 유형 : 배열, 구현, 연결리스트 문제 난이도 : Medium 문제 Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears once or twice, return an array of all the integers that appears twice. You must write an algorithm that runs in O(n) t..
https://leetcode.com/problems/find-the-duplicate-number/description/ Leetcode - Find the Duplicate Number 문제 유형 : 배열, 연결리스트, 투 포인터 문제 난이도 : Medium 문제 Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nums, return this repeated number. You must solve the problem without modifying the array nums and u..
https://leetcode.com/problems/reorder-list/description/ Leetcode - Reorder List 문제 유형 : 연결리스트, 스택 문제 난이도 : Medium 문제 You are given the head of a singly linked-list. The list can be represented as: L0 → L1 → … → Ln - 1 → Ln Reorder the list to be on the following form: L0 → Ln → L1 → Ln - 1 → L2 → Ln - 2 → … You may not modify the values in the list's nodes. Only nodes themselves may be changed. ..
https://leetcode.com/problems/palindrome-linked-list/description/ Leetcode - Palindrome Linked List 문제 유형 : 연결 리스트 문제 난이도 : Easy 문제 Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Follow up: Could you do it in O(n) time and O(1) space? 단순 연결리스트의 head가 주어진다. 팰린드롬이면 true를, 아니라면 false를 반환하시오. ++: O(n)의 시간과 O(1)의 공간복잡도로 하실 수 있으시겠습니까? 풀이 그냥 따로 데이터를 저장하는 식..