SW개발/코딩테스트

    [LeetCode]Unique Paths

    https://leetcode.com/problems/unique-paths/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 문제 분석 주어진 그리드에서 가장 오른쪽 아래로 가는 Unique 경로의 수를 구하는 문제입니다. 처음 시도한 답안 - 실패, DFS 이용 class Solution: def uniquePaths(self, m: ..

    [LeetCode]House Robber II

    https://leetcode.com/problems/house-robber-ii/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 rob(self, nums..

    [LeetCode]House Robber

    https://leetcode.com/problems/house-robber/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 rob(self, nums: List[int]) -> int: if len(..

    [LeetCode]Maximal Square

    https://leetcode.com/problems/maximal-square/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 문제 분석 주어진 이차원 Matrix에서 가장 큰 정사각형에 포함된 1의 갯수를 구하는 문제입니다. 처음 시도한 답안 - 실패 class Solution: def maximalSquare(self, matrix..

    [LeetCode]Triangle

    https://leetcode.com/problems/triangle/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 문제 분석 triangle 리스트가 주어질 때 위에서부터 아래로 이동시 가장 최소가 되는 경로의 합을 구하는 문제입니다. 처음 시도한 답안 class Solution: def minimumTotal(self, triang..

    [백준]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]])..