목록투포인터 (43)
넘치게 채우기
https://leetcode.com/problems/separate-black-and-white-balls/description/?envType=daily-question&envId=2024-10-15leetcode - Separate Black and White Balls문제 유형: 투 포인터, 그리디문제 난이도 : Medium 문제There are n balls on a table, each ball has a color black or white.You are given a 0-indexed binary string s of length n, where 1 and 0 represent black and white balls, respectively.In each step, you can choos..
https://leetcode.com/problems/sentence-similarity-iii/description/?envType=daily-question&envId=2024-10-06leetcode - Sentence Similarity III문제 유형 : 문자열 처리, 투 포인터문제 난이도 : Medium 문제You are given two strings sentence1 and sentence2, each representing a sentence composed of words. A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each word consist..
https://leetcode.com/problems/divide-players-into-teams-of-equal-skill/description/?envType=daily-question&envId=2024-10-04leetcode - Divide Players Into Teams of Equal Skill문제 유형 : 정렬, 그리디, 투 포인터문제 난이도 : Medium 문제You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that the total skil..
https://leetcode.com/problems/strange-printer/description/?envType=daily-question&envId=2024-08-21leetcode - Strange Printer문제 유형 : 문자열 처리, 재귀, 다이나믹 프로그래밍, 투 포인터문제 난이도 : Hard 문제There is a strange printer with the following two special properties:The printer can only print a sequence of the same character each time.At each turn, the printer can print new characters starting from and ending at any..
https://leetcode.com/problems/find-k-th-smallest-pair-distance/description/?envType=daily-question&envId=2024-08-14leetcode - Find K-th Smallest Pair Distance문제 유형 : 투 포인터, 이진탐색문제 난이도 : Hard 문제The distance of a pair of integers a and b is defined as the absolute difference between a and b.Given an integer array nums and an integer k, return the kth smallest distance among all the pairs nums[i] a..
https://leetcode.com/problems/count-number-of-teams/description/?envType=daily-question&envId=2024-07-29leetcode - Count Number of Teams문제 유형 : 투 포인터문제 난이도 : Medium 문제There are n soldiers standing in a line. Each soldier is assigned a unique rating value.You have to form a team of 3 soldiers amongst them under the following rules:Choose 3 soldiers with index (i, j, k) with rating (rating[i], ra..
https://leetcode.com/problems/sort-an-array/description/leetcode - Sort an Array문제 유형 : 정렬, 투포인터문제 난이도 : Medium 문제Given an array of integers nums, sort the array in ascending order and return it.You must solve the problem without using any built-in functions in O(nlog(n)) time complexity and with the smallest space complexity possible. 정수 배열 nums가 주어진다. 오름차순으로 순서를 정렬하고 반환하시오.아무런 built-in 함수도 사용하..
https://leetcode.com/problems/merge-nodes-in-between-zeros/description/leetcode - Merge Nodes in Between Zeros문제 유형 : 연결리스트, 투 포인터문제 난이도 : Medium 문제You are given the head of a linked list, which contains a series of integers separated by 0's. The beginning and end of the linked list will have Node.val == 0.For every two consecutive 0's, merge all the nodes lying in between them into a single nod..
https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/description/leetcode - Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit문제 유형 : 슬라이딩 윈도우, 투 포인터, 데크(deque)문제 난이도 : Medium 문제Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference betwee..
https://leetcode.com/problems/count-number-of-nice-subarrays/description/leetcode - Count Number of Nice Subarrays문제 유형 : 슬라이딩 윈도우, 투포인터문제 난이도 : Medium 문제Given an array of integers nums and an integer k. A continuous subarray is called nice if there are k odd numbers on it.Return the number of nice sub-arrays. 정수배열 nums와 정수 k가 주어집니다. 연속적인 부분배열의 요소에 홀수의 요소가 정확히 k개 있으면, nice한 subarray입니다.nice한 sub..