SW개발/코딩테스트

    [LeetCode]Diagonal Traverse

    https://leetcode.com/problems/diagonal-traverse/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 문제 분석 주어진 m*n 그리드를 대각선 위 대각선 아래로 반복하면서 탐색하는 순서를 구하는 문제입니다. 처음 시도한 답안 class Solution: def findDiagonalOrder(self, m..

    [LeetCode]Game of Life

    https://leetcode.com/problems/game-of-life/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 gameOfLife(self, board: List[List[int]]) -> N..

    [LeetCode]Add Binary

    https://leetcode.com/problems/add-binary/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 addBinary(self, a: str, b: str) -> str: return bin(..

    [LeetCode]Longest Common Subsequence

    https://leetcode.com/problems/longest-common-subsequence/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 문제 분석 text1과 text2가 주어질때 가장 긴 공통 부분 문자열을 구하는 문제입니다. 처음 시도한 답안 - 실패 class Solution: def longestCommonSubse..

    [LeetCode]Next Greater Element I

    https://leetcode.com/problems/next-greater-element-i/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 문제 분석 nums1과 nums2 리스트가 주어집니다. nums1 리스트는 nums2 리스트의 subset입니다. nums1의 숫자가 nums2에서 위치한 곳보다 뒤에서 큰 숫자를 발견하면 그 숫..

    [LeetCode]Daily Temperatures

    https://leetcode.com/problems/daily-temperatures/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 문제 분석 주어진 온도에서 며칠 뒤에 따뜻해지는지를 구하는 문제입니다. 따뜻해지지 않는다면 0으로 설정합니다. 처음 시도한 답안 class Solution: def dailyTemperatures(sel..

    [LeetCode]Coin Change

    https://leetcode.com/problems/coin-change/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 문제 분석 coins과 amount가 주어지면 가장 적은 코인으로 amount를 만드는 문제입니다. 만들 수 없다면 -1을 리턴합니다. 처음 시도한 답안 from collections import deque cla..

    [LeetCode]Decode String

    https://leetcode.com/problems/decode-string/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(object): def decodeString(se..

    [Leetcode]Binary Tree Right Side View

    https://leetcode.com/problems/binary-tree-right-side-view/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 문제 분석 이진 트리가 주어졌을때 오른쪽에서 본 순서대로 출력합니다. 처음 시도한 답안 - 실패 # Definition for a binary tree node. # class TreeN..

    [LeetCode]Product of Array Except Self

    https://leetcode.com/problems/product-of-array-except-self/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 문제 분석 nums 배열이 주어지면 자신을 제외한 숫자들의 곱을 구하는 문제입니다. 단, 나눗셈 연산은 금지되어 있습니다. 처음 시도한 답안 class Solution: def prod..