[Swift 알고리즘] 백준 마법사 상어와 파이어볼, 토네이도, 파이어스톰, 비바라기(20056, 20057, 20058, 21610)
·
코딩테스트
백준의 마법사 상어 시리즈 중 파이어볼, 토네이도, 파이어스톰, 비바라기 문제입니다. 단순 구현 문제라 코드가 길어 전체 코드는 링크로 첨부합니다. 모든 코드는 https://github.com/jeongju9216/Algorithm/tree/main/Swift 에서 볼 수 있습니다. Swift 코드가 올라와 있는게 많이 없어서 자세한 풀이보다는 개인 복습 겸 올렸습니다. 마법사 상어와 파이어볼 (BOJ 20056) 풀이 코드 : https://github.com/jeongju9216/Algorithm/blob/main/Swift/BOJ/20000/20056.swift 파이어볼을 범위 밖으로도 이동 시키는 작업이 포인트인 문제입니다. 질량이 0인 파이어볼은 사라진다는 점 파이어볼은 4방향으로 퍼지는게 아..
[Swift 알고리즘] LeetCode - 48. Rotate Image
·
코딩테스트
Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 https://leetcode.com/problems/rotate-image/ Rotate Image - 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 풀이 이번 ..
[Swift 알고리즘] LeetCode - 230. Kth Smallest Element in a BST
·
코딩테스트
Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 Kth Smallest Element in a BST - 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 풀이 k번째 수를 BST에서 탐색하여 구하는 문제입니다. 처..
[Swift 알고리즘] LeetCode - 22. Generate Parentheses
·
코딩테스트
Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 Generate Parentheses - 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 풀이 이번 문제는 올바른 괄호가 n쌍인 모든 문자열을 구하는 문제입니다. n..
[Swift 알고리즘] LeetCode - 206. Reverse Linked List
·
코딩테스트
Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 Reverse Linked List - 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 풀이 단방향 링크드 리스트를 역순으로 뒤집어야 하는 문제입니다. Easy 난이..
[Swift 알고리즘] LeetCode - 2181. Merge Nodes in Between Zeros
·
코딩테스트
Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 Merge Nodes in Between Zeros - 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 풀이 이번 문제는 링크드 리스트 문제로 탐색과 삽입을 모두 물..
[Swift 알고리즘] LeetCode 1302 - Deepest Leaves Sum
·
코딩테스트
Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 Deepest Leaves Sum - 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 풀이 1302 문제의 주의점은 leaf 노드가 아니라 최대 깊이의 노드의 합이라..
[Swift 알고리즘] LeetCode 1689 - Partitioning Into Minimum Number Of Deci-Binary Numbers
·
코딩테스트
Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 Partitioning Into Minimum Number Of Deci-Binary Numbers - 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 풀이 이번 문..
[Swift 알고리즘] 백준 BOJ - 2636 치즈
·
코딩테스트
Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 2636번: 치즈 아래 과 같이 정사각형 칸들로 이루어진 사각형 모양의 판이 있고, 그 위에 얇은 치즈(회색으로 표시된 부분)가 놓여 있다. 판의 가장자리(에서 네모 칸에 X친 부분)에는 치즈가 놓 www.acmicpc.net 풀이 이번 문제는 BFS 문제입니다. 가장자리의 치즈는 1시간이 지나면 녹습니다. 모든 치즈가 녹는데 소요되는 시간과 모두 녹기 직전 남은 치즈의 수를 출력해야 합니다. while t..
[Swift 알고리즘] Codility - Triangle
·
코딩테스트
안녕하세요. 개발 중인 정주입니다. 오늘은 "Codility - Triangle" 문제를 풀었습니다. Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 Triangle coding task - Learn to Code - Codility Determine whether a triangle can be built from a given set of edges. app.codility.com 풀이 이번 문제는 아래 조건을 만족하는 세 수가 있는지 확인하는 문제..
[Swift 알고리즘] Codility - MaxProductOfThree
·
코딩테스트
안녕하세요. 개발 중인 정주입니다. 오늘은 "Codility - MaxProductOfThree" 문제를 풀었습니다. Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 MaxProductOfThree coding task - Learn to Code - Codility Maximize A[P] * A[Q] * A[R] for any triplet (P, Q, R). app.codility.com 풀이 이번 문제는 배열에서 랜덤한 세 개의 수를 곱했을 때의 ..
[Swift 알고리즘] Codility - Distinct
·
코딩테스트
안녕하세요. 개발 중인 정주입니다. 오늘은 "Codility - Distinct" 문제를 풀었습니다. Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 Distinct coding task - Learn to Code - Codility Compute number of distinct values in an array. app.codility.com 풀이 이번 문제는 배열에서 고유한 값의 개수를 구하는 문제입니다. [1, 1, 2, 3, 3]이면 [1, 2..
[Swift 알고리즘] Codility - MinAvgTwoSlice
·
코딩테스트
안녕하세요. 개발 중인 정주입니다. 오늘은 "Codility - MinAvgTwoSlice" 문제를 풀었습니다. Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 MinAvgTwoSlice coding task - Learn to Code - Codility Find the minimal average of any slice containing at least two elements. app.codility.com 풀이 이번 문제는 평균이 최소가 되는 구간..
[Swift 알고리즘] Codility - CountDiv
·
코딩테스트
안녕하세요. 개발 중인 정주입니다. 오늘은 "Codility - CountDiv" 문제를 풀었습니다. Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 CountDiv coding task - Learn to Code - Codility Compute number of integers divisible by k in range [a..b]. app.codility.com 풀이 이번 문제는 A
[Swift 알고리즘] Codility - PassingCars
·
코딩테스트
안녕하세요. 개발 중인 정주입니다. 오늘은 "Codility - PassingCars" 문제를 풀었습니다. Github GitHub - jeongju9216/SwiftAlgorithm: 스위프트 알고리즘 스위프트 알고리즘. Contribute to jeongju9216/SwiftAlgorithm development by creating an account on GitHub. github.com 문제 링크 PassingCars coding task - Learn to Code - Codility Count the number of passing cars on the road. app.codility.com 풀이 이번 문제는 east로 가는 이동하는 차의 index보다 큰 west로 이동하는 차의 inde..
유정주
'swift 알고리즘' 태그의 글 목록