[LeetCode] 1706. Where Will the Ball Fall (Python)
·
Algorithm
LeetCode 1706. Where Will the Ball Fall 🗓️ Daily LeetCoding Challenge November, Day 1 Simulation https://leetcode.com/problems/where-will-the-ball-fall/ Where Will the Ball Fall - LeetCode 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 1. 문제 설명 모든 열마다 공을 하나씩 굴렸을 때, 각 공이 어디로 도착할지 시뮬레이션 하는 문..
[LeetCode] 3. Longest Substring Without Repeating Characters (Python)
·
Algorithm
LeetCode 3. Longest Substring Without Repeating Characters String https://leetcode.com/problems/longest-substring-without-repeating-characters/ Longest Substring Without Repeating Characters - LeetCode 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 1. 문제 설명 Longest Substring Without Repeat..
[BOJ] 1012번: 유기농 배추 (Python)
·
Algorithm
백준 1012번: 유기농 배추 Graph theory / DFS / BFS https://www.acmicpc.net/problem/1012 1012번: 유기농 배추 차세대 영농인 한나는 강원도 고랭지에서 유기농 배추를 재배하기로 하였다. 농약을 쓰지 않고 배추를 재배하려면 배추를 해충으로부터 보호하는 것이 중요하기 때문에, 한나는 해충 방지에 www.acmicpc.net 1. 문제 설명 유기농 배추는 해충으로부터 보호하기 위해 배추흰지렁이가 총 몇 마리가 필요한지 구하는 문제이다. 전형적인 그래프 이론 문제로, 이를 해결하기 위해 DFS 혹은 BFS를 사용하여 해결한다. 배열이 주어지는 그래프 이론의 문제를 처음 접하면 문제를 읽고 이해하기가 난감한 경우가 발생한다. 특히 배추흰지렁이의 이동 루틴이 헷..
[BOJ] 9252번: LCS 2 (Python)
·
Algorithm
백준 9252번: LCS 2 Dynamic Programming https://www.acmicpc.net/problem/9252 9252번: LCS 2 LCS(Longest Common Subsequence, 최장 공통 부분 수열)문제는 두 수열이 주어졌을 때, 모두의 부분 수열이 되는 수열 중 가장 긴 것을 찾는 문제이다. 예를 들어, ACAYKP와 CAPCAK의 LCS는 ACAK가 된다. www.acmicpc.net 1. 문제 설명 이 문제는 LCS를 구하는 과정이 백준 9521번과 완전히 동일하다. (Input, Output 형식도 같다!) 따라서, LCS를 구하는 방법에 대해서는 이전 글을 참고하면 된다. https://lucple.tistory.com/31 만약 문자열 X와 Y가 다음과 같다고..
[BOJ] 9251번: LCS (Python)
·
Algorithm
백준 9251번: LCS Dynamic Programming https://www.acmicpc.net/problem/9251 9251번: LCS LCS(Longest Common Subsequence, 최장 공통 부분 수열)문제는 두 수열이 주어졌을 때, 모두의 부분 수열이 되는 수열 중 가장 긴 것을 찾는 문제이다. 예를 들어, ACAYKP와 CAPCAK의 LCS는 ACAK가 된다. www.acmicpc.net 1. 문제 설명 LCS는 두개의 문자열이 주어졌을때, 공통적으로 가장 긴 subsequence를 찾는 문제이다. 이때, substring과 달리 subsequence는 문자열이 연속적이지 않아도 된다. 만약, 문자열 X와 Y가 다음과 같다고 하자. X = Y = 이때 생성될 수 있는 subse..