스트리밍 사이트에서 장르 별로 가장 많이 재생된 노래를 두 개씩 모아 베스트 앨범을 출시하려 합니다. 노래는 고유 번호로 구분하며, 노래를 수록하는 기준은 다음과 같습니다. 속한 노래가 많이 재생된 장르를 먼저 수록합니다. 장르 내에서 많이 재생된 노래를 먼저 수록
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
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each i
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes cont
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "".
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if
정렬되어있는 두 배열 A와 B가 주어진다. 두 배열을 합친 다음 정렬해서 출력하는 프로그램을 작성하시오.
정수를 저장하는 스택을 구현한 다음, 입력으로 주어지는 명령을 처리하는 프로그램을 작성하시오. 명령은 총 다섯 가지이다.
문장이 주어졌을 때, 단어를 모두 뒤집어서 출력하는 프로그램을 작성하시오. 단, 단어의 순서는 바꿀 수 없다. 단어는 영어 알파벳으로만 이루어져 있다.
스택 (stack)은 기본적인 자료구조 중 하나로, 컴퓨터 프로그램을 작성할 때 자주 이용되는 개념이다. 스택은 자료를 넣는 (push) 입구와 자료를 뽑는 (pop) 입구가 같아 제일 나중에 들어간 자료가 제일 먼저 나오는 (LIFO, Last in First out
🔎 문제설명 You are given the root of a binary search tree (BST) and an integer val. Find the node in the BST that the node's value equals val and retur
Example 1Example 2Example 3제한사항0 <= s.length <= 5 \* $$10^4$$s consists of English letters, digits, symbols and spaces.한글자씩 확인하면서 이미 앞에서 나온 문자면
문제링크한 줄로 된 간단한 에디터를 구현하려고 한다. 이 편집기는 영어 소문자만을 기록할 수 있는 편집기로, 최대 600,000글자까지 입력할 수 있다.이 편집기에는 '커서'라는 것이 있는데, 커서는 문장의 맨 앞(첫 번째 문자의 왼쪽), 문장의 맨 뒤(마지막 문자의
문제링크요세푸스 문제는 다음과 같다.1번부터 N번까지 N명의 사람이 원을 이루면서 앉아있고, 양의 정수 K(≤ N)가 주어진다. 이제 순서대로 K번째 사람을 제거한다. 한 사람이 제거되면 남은 사람들로 이루어진 원을 따라 이 과정을 계속해 나간다. 이 과정은 N명의 사
Example 1Example 2제한사항1 <= s.length <= 1000s consist of only digits and English letters.
🔎문제설명 Design a HashSet without using any built-in hash table libraries. Implement MyHashSet class: void add(key) Inserts the value key into the Has
문제링크인체에 치명적인 바이러스를 연구하던 연구소에서 바이러스가 유출되었다. 다행히 바이러스는 아직 퍼지지 않았고, 바이러스의 확산을 막기 위해서 연구소에 벽을 세우려고 한다.연구소는 크기가 N×M인 직사각형으로 나타낼 수 있으며, 직사각형은 1×1 크기의 정사각형으로
contest 290 leetcode에서 처음 contest에 참가해보았습니다. 문제는 4문제가 나왔구요. 난이도는 Easy 1 , Medium 2, Hard 1 였습니다. 2248. Intersection of Multiple Arrays 🔎 문제설명 Giv
남은 두 문제는 저는 풀지 못했습니다.다른 사람들의 코드를 보면서 분석해보겠습니다.Example 1(2,1) 좌표는 두개의 사각형에 포함되고 (1,4)좌표는 1개의 사각형에만 포함되어 2,1을 반환합니다.Example 2쉬워보이겠죠.제한조건을 보기전까진 brutefor
contest 290 마지막 문제입니다.You are given a 0-indexed 2D integer array flowers, where flowersi = starti, endi means the ith flower will be in full bloom fro
문자열 S가 주어졌을 때, 이 문자열에서 단어만 뒤집으려고 한다.먼저, 문자열 S는 아래와과 같은 규칙을 지킨다.알파벳 소문자('a'-'z'), 숫자('0'-'9'), 공백(' '), 특수 문자('<', '>')로만 이루어져 있다.문자열의 시작과 끝은 공백이 아니
You are given an array points representing integer coordinates of some points on a 2D-plane, where pointsi = xi, yi.The cost of connecting two points
크기가 N인 수열 A = A1, A2, ..., AN이 있다. 수열의 각 원소 Ai에 대해서 오큰수 NGE(i)를 구하려고 한다. Ai의 오큰수는 오른쪽에 있으면서 Ai보다 큰 수 중에서 가장 왼쪽에 있는 수를 의미한다. 그러한 수가 없는 경우에 오큰수는 -1이다.예를
You are given a string s, and an array of pairs of indices in the string pairs where pairsi = a, b indicates 2 indices(0-indexed) of the string.You ca
제한사항graph.length == n1 ≤ n ≤ 1000 ≤ graphu.length < n0 ≤ graphu ≤ n - 1graphu does not contain u.All the values of graphu are unique.If graphu cont
You are given a string number representing a positive integer and a character digit.Return the resulting string after removing exactly one occurrence
You are given an integer array cards where cardsi represents the value of the ith card. A pair of cards are matching if the cards have the same value.
Given an integer array nums and two integers k and p, return the number of distinct subarrays which have at most k elements divisible by p.Two arrays
The appeal of a string is the number of distinct characters found in the string.For example, the appeal of "abbca" is 3 because it has 3 distinct char
Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array wil
You are given a string array words and a string s, where wordsi and s comprise only of lowercase English letters.Return the number of strings in words
You are given a 0-indexed integer array nums of length n.The average difference of the index i is the absolute difference between the average of the f
You are given two integers m and n representing a 0-indexed m x n grid. You are also given two 2D integer arrays guards and walls where guardsi = rowi
수식은 일반적으로 3가지 표기법으로 표현할 수 있다. 연산자가 피연산자 가운데 위치하는 중위 표기법(일반적으로 우리가 쓰는 방법이다), 연산자가 피연산자 앞에 위치하는 전위 표기법(prefix notation), 연산자가 피연산자 뒤에 위치하는 후위 표기법(postfi
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any
The k-beauty of an integer num is defined as the number of substrings of num when it is read as a string that meet the following conditions:It has a l
You are given a 0-indexed integer array nums of length n.nums contains a valid split at index i if the following are true:The sum of the first i + 1 e
1742년, 독일의 아마추어 수학가 크리스티안 골드바흐는 레온하르트 오일러에게 다음과 같은 추측을 제안하는 편지를 보냈다.4보다 큰 모든 짝수는 두 홀수 소수의 합으로 나타낼 수 있다.예를 들어 8은 3 + 5로 나타낼 수 있고, 3과 5는 모두 홀수인 소수이다. 또,
트리에서 리프 노드란, 자식의 개수가 0인 노드를 말한다.트리가 주어졌을 때, 노드 하나를 지울 것이다. 그 때, 남은 트리에서 리프 노드의 개수를 구하는 프로그램을 작성하시오. 노드를 지우면 그 노드와 노드의 모든 자손이 트리에서 제거된다.예를 들어, 다음과 같은 트
You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypesi = numberOfBoxesi, numberOfUnitsPerBoxi
You are given a string s, where every two consecutive vertical bars '|' are grouped into a pair. In other words, the 1st and 2nd '|' make a pair, the
🔎문제설명 두 개의 단어 begin, target과 단어의 집합 words가 있습니다. 아래와 같은 규칙을 이용하여 begin에서 target으로 변환하는 가장 짧은 변환 과정을 찾으려고 합니다. 두 개의 단어 begin, target과 단어의 집합 words가
각 점에 가중치가 부여된 트리가 주어집니다. 당신은 다음 연산을 통하여, 이 트리의 모든 점들의 가중치를 0으로 만들고자 합니다.임의의 연결된 두 점을 골라서 한쪽은 1 증가시키고, 다른 한쪽은 1 감소시킵니다.하지만, 모든 트리가 위의 행동을 통하여 모든 점들의 가중
1차 문제집
공개일 - 2022.07.27. 14:00종료일 - 2022.08.23. 23:59제한시간 180분1차 문제집과는 다르게 2차 문제집은 총 3문제였습니다.3문제 모두 풀었고, 문제 난이도는 1차에 비해서 많이 쉬웠습니다.1번 문제는 제가 파이썬으로 풀어서 그런지 5분도
모의고사 보러가기😀공개일 - 2022.08.10. 14:00종료일 - 2022.08.23. 23:59제한시간 180분3차는 문제 자체가 어려운건 아니였으나, 문제를 이해하는데 시간이 너무 오래 걸렸습니다..총 4문제였고, 2,3번에서 시간을 너무 많이 써서 4번을 풀