출처n명의 권투선수가 권투 대회에 참여했고 각각 1번부터 n번까지 번호를 받았습니다. 권투 경기는 1대1 방식으로 진행이 되고, 만약 A 선수가 B 선수보다 실력이 좋다면 A 선수는 B 선수를 항상 이깁니다. 심판은 주어진 경기 결과를 가지고 선수들의 순위를 매기려 합
출처n개의 노드가 있는 그래프가 있습니다. 각 노드는 1부터 n까지 번호가 적혀있습니다. 1번 노드에서 가장 멀리 떨어진 노드의 갯수를 구하려고 합니다. 가장 멀리 떨어진 노드란 최단경로로 이동했을 때 간선의 개수가 가장 많은 노드들을 의미합니다.노드의 개수 n, 간선
출처출발지점부터 distance만큼 떨어진 곳에 도착지점이 있습니다. 그리고 그사이에는 바위들이 놓여있습니다. 바위 중 몇 개를 제거하려고 합니다.예를 들어, 도착지점이 25만큼 떨어져 있고, 바위가 2, 14, 11, 21, 17 지점에 놓여있을 때 바위 2개를 제거
출처n명이 입국심사를 위해 줄을 서서 기다리고 있습니다. 각 입국심사대에 있는 심사관마다 심사하는데 걸리는 시간은 다릅니다.처음에 모든 심사대는 비어있습니다. 한 심사대에서는 동시에 한 명만 심사를 할 수 있습니다. 가장 앞에 서 있는 사람은 비어 있는 심사대로 가서
출처주어진 항공권을 모두 이용하여 여행경로를 짜려고 합니다. 항상 "ICN" 공항에서 출발합니다.항공권 정보가 담긴 2차원 배열 tickets가 매개변수로 주어질 때, 방문하는 공항 경로를 배열에 담아 return 하도록 solution 함수를 작성해주세요.모든 공항은
출처두 개의 단어 begin, target과 단어의 집합 words가 있습니다. 아래와 같은 규칙을 이용하여 begin에서 target으로 변환하는 가장 짧은 변환 과정을 찾으려고 합니다.한 번에 한 개의 알파벳만 바꿀 수 있습니다.words에 있는 단어로만 변환할 수
출처네트워크란 컴퓨터 상호 간에 정보를 교환할 수 있도록 연결된 형태를 의미합니다. 예를 들어, 컴퓨터 A와 컴퓨터 B가 직접적으로 연결되어있고, 컴퓨터 B와 컴퓨터 C가 직접적으로 연결되어 있을 때 컴퓨터 A와 컴퓨터 C도 간접적으로 연결되어 정보를 교환할 수 있습니
출처n개의 음이 아닌 정수가 있습니다. 이 수를 적절히 더하거나 빼서 타겟 넘버를 만들려고 합니다. 예를 들어 1, 1, 1, 1, 1로 숫자 3을 만들려면 다음 다섯 방법을 쓸 수 있습니다.\-1+1+1+1+1 = 3\+1-1+1+1+1 = 3\+1+1-1+1+1 =
출처도둑이 어느 마을을 털 계획을 하고 있습니다. 이 마을의 모든 집들은 아래 그림과 같이 동그랗게 배치되어 있습니다.각 집들은 서로 인접한 집들과 방범장치가 연결되어 있기 때문에 인접한 두 집을 털면 경보가 울립니다.각 집에 있는 돈이 담긴 배열 money가 주어질
출처계속되는 폭우로 일부 지역이 물에 잠겼습니다. 물에 잠기지 않은 지역을 통해 학교를 가려고 합니다. 집에서 학교까지 가는 길은 m x n 크기의 격자모양으로 나타낼 수 있습니다.아래 그림은 m = 4, n = 3 인 경우입니다.가장 왼쪽 위, 즉 집이 있는 곳의 좌
A non-empty array A consisting of N integers is given.A permutation is a sequence containing each element from 1 to N once, and only once.For example,
This is a demo task.Write a function:def solution(A)that, given an array A of N integers, returns the smallest positive integer (greater than 0) that
You are given N counters, initially set to 0, and you have two possible operations on them:increase(X) − counter X is increased by 1,max counter − all
A small frog wants to get to the other side of a river. The frog is initially located on one bank of the river (position 0) and wants to get to the op
A non-empty array A consisting of N integers is given. Array A represents numbers on a tape.Any integer P, such that 0 < P < N, splits this tape
An array A consisting of N different integers is given. The array contains integers in the range 1..(N + 1), which means that exactly one element is m
A small frog wants to get to the other side of the road. The frog is currently located at position X and wants to get to a position greater than or eq
A non-empty array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be paired with
An array A consisting of N integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the
A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representa