본문 바로가기
728x90
반응형

Xcode/Swift - Algorithm58

Swift ) LeetCode(Medium) - Find the City With the Smallest Number of Neighbors at a Threshold Distance (Floyd - Warshall) leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/discuss/?currentPage=1&orderBy=hot&query= Find the City With the Smallest Number of Neighbors at a Threshold Distance - LeetCode Discuss 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 안녕하세요 후르.. 2020. 9. 19.
Swift ) 프로그래머스 (Lv3) - 경주로 건설 (BFS) programmers.co.kr/learn/courses/30/lessons/67259 코딩테스트 연습 - 경주로 건설 [[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,1,0,0,0],[0,0,0,1,0,0,0,1],[0,0,1,0,0,0,1,0],[0,1,0,0,0,1,0,0],[1,0,0,0,0,0,0,0]] 3800 [[0,0,1,0],[0,0,0,0],[0,1,0,1],[1,0,0,0]] 2100 [[0,0,0,0,0,0],[0,1,1,1,1,0],[0,0,1,0,0,0],[1,0,0,1,0,1],[ programmers.co.kr 안녕하세요 후르륵짭짭 입니다. 처음에 이 문제를 DFS로 풀었습니다. 그런데 시간초과,,,,, 왜 시.. 2020. 9. 11.
Swift ) 프로그래머스(Lv3) - 보석 쇼핑 (TwoPointer & Hash) programmers.co.kr/learn/courses/30/lessons/67258 코딩테스트 연습 - 보석 쇼핑 ["DIA", "RUBY", "RUBY", "DIA", "DIA", "EMERALD", "SAPPHIRE", "DIA"] [3, 7] programmers.co.kr 안녕하세요 후르륵짭짭 입니다. 지금 까지 모든 프로그래머스 Lv2를 다 끝내고 이제,, Lv3를 문제를 풀게 됐습니다. 결론 부터 말하면,,, Lv2는 어떻게 생각하면 풀 수 있지만,,, Lv3는 아직 많이 부족한 것 같습니다. 두 문제 밖에 안 풀어봤지만,,, Lv1에서 Lv2로 올라간 만큼 Lv2에서 Lv3로 올라간 것 같습니다. 그럼 문제에 본격적인 해설을 하도록 하겠습니다. ** 저의 해설 ** func solutio.. 2020. 9. 11.
Swift ) 프로그래머스(Lv2) - [3차] n진수 게임 (String) programmers.co.kr/learn/courses/30/lessons/17687 코딩테스트 연습 - [3차] n진수 게임 N진수 게임 튜브가 활동하는 코딩 동아리에서는 전통적으로 해오는 게임이 있다. 이 게임은 여러 사람이 둥글게 앉아서 숫자를 하나씩 차례대로 말하는 게임인데, 규칙은 다음과 같다. 숫자를 0� programmers.co.kr 안녕하세요 후르륵짭잡 입니다. 이 문제는 Swift의 String radix를 이용하면 쉽게 풀 수 있는 문제였습니다. 처음에는 문제가 이해 안됐으나, 계속 읽어보니 이해가 됐습니다. ** 저의 풀이 ** //0:20 func solution(_ n:Int, _ t:Int, _ m:Int, _ p:Int) -> String { var say = 0 var i.. 2020. 9. 10.
728x90
반응형