분류 전체보기

    [백준]ABCDE - 13023번

    https://www.acmicpc.net/problem/13023 13023번: ABCDE 문제의 조건에 맞는 A, B, C, D, E가 존재하면 1을 없으면 0을 출력한다. www.acmicpc.net 문제 분석 친구 관계들이 주어질 때, 아래의 조건에 해당하는 친구 관계가 있는지 구하는 문제입니다. 조건 : 오늘은 다음과 같은 친구 관계를 가진 사람 A, B, C, D, E가 존재하는지 구해보려고 한다. A는 B와 친구다. B는 C와 친구다. C는 D와 친구다. D는 E와 친구다. 처음 시도한 답안 import sys def main(): person_count, relation_count = map(int, sys.stdin.readline().split()) graph = [[] for _ in..

    [LeetCode]Unique Binary Search Trees

    https://leetcode.com/problems/unique-binary-search-trees/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 n이 주어지면 유니크한 BST가 몇개인지를 구하는 문제입니다. 처음 시도한 답안 class Solution: def numTrees(self, n: int) -> int: dp ..

    [LeetCode]Find All Groups of Farmland

    https://leetcode.com/problems/find-all-groups-of-farmland/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 이어진 농토들에서 각각 가장 왼쪽, 가장 오른쪽 지점의 좌표를 구하는 문제입니다. 정답에서 농토의 순서는 상관없습니다. 처음 시도한 답안 class Solution: def f..

    [LeetCode]Count Sub Islands

    https://leetcode.com/problems/count-sub-islands/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 왼쪽 그리드의 섬들 집합에서 오른쪽 그리드를 비교했을 때 Sub Islands는 몇개인지 구하는 문제입니다. 처음 시도한 답안 - 실패 class Solution: def countSubIsla..

    [LeetCode]Max Area of Island

    https://leetcode.com/problems/max-area-of-island/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 주어진 그리드에서 가장 큰 섬의 크기를 구하는 문제입니다. 처음 시도한 답안 class Solution: def maxAreaOfIsland(self, grid: List[List[int]])..

    [LeetCode]Valid Palindrome

    https://leetcode.com/problems/valid-palindrome/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 주어진 문자열이 유효한 Palindrome인지 구하는 문제입니다. 처음 시도한 답안 class Solution: def isPalindrome(self, s: str) -> bool: s = s...

    [LeetCode]Course Schedule

    https://leetcode.com/problems/course-schedule/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 강의 과목과 먼저 들어야만 하는 강의 정보가 주어지면, 강의를 모두 수강할 수 있는지 구하는 문제입니다. 처음 시도한 답안 class Solution: def canFinish(self, numCo..

    [LeetCode]Number of Islands

    https://leetcode.com/problems/number-of-islands/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 2차원 그리드에서 1로 연결이 된 섬의 갯수를 구하는 문제입니다. 처음 시도한 답안 - DFS class Solution: def numIslands(self, grid: List[List[st..

    [LeetCode]Clumsy Factorial

    https://leetcode.com/problems/clumsy-factorial/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 Factorial의 연산을 * / + - 연산자를 순서대로 rotation하면서 계산한 결과를 구하는 문제입니다. 처음 시도한 답안 class Solution: def clumsy(self, n: int) -> int..

    [LeetCode]Complex Number Mutiplication

    https://leetcode.com/problems/complex-number-multiplication/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 real + imaginary i로 이루어진 두개의 숫자를 곱한 결과를 출력하는 문제입니다. 허수의 제곱은 -1로 간주합니다. 처음 시도한 답안 class Solution:..