recursion

개발공부/algorithm

[프로그래머스][python] 괄호 변환 - Stack, Recursion

문제 프로그래머스 괄호변환 Level 2 Link 코딩테스트 연습 - 괄호 변환 카카오에 신입 개발자로 입사한 "콘"은 선배 개발자로부터 개발역량 강화를 위해 다른 개발자가 작성한 소스 코드를 분석하여 문제점을 발견하고 수정하라는 업무 과제를 받았습니다. 소스를 programmers.co.kr 나의 접근 와 이문제는.. 도저히 레벨 2라고 믿기 힘들 정도로 엄청 복잡한 재귀 로직을 짜는 것을 요구한다. 문제 이해가 너무 어려워서 계속 숙제처럼 미뤄두다가 오늘 도전한 문제..! 한 번에 모든 테케 통과해서 기분이 매우 좋다 ㅎㅎ 1. 입력이 빈 문자열인 경우, 빈 문자열을 반환합니다. 2. 문자열 w를 두 "균형잡힌 괄호 문자열" u, v로 분리합니다. 단, u는 "균형잡힌 괄호 문자열"로 더 이상 분리할..

개발공부/algorithm

[Leetcode][python] 563. Binary Tree Tilt - DFS

Leetcode 563. Binary Tree Tilt Level: easy Link Binary Tree Tilt - 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 My Approach # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right..

개발공부/algorithm

[Leetcode][python] 690 - Employee importance - DFS

Leetcode 690: Employee importance Level: easy Link Employee Importance - 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 My approach Iterate through nested list and store employee id and importance in a dictionary Perform dfs with starting id sum up the importance of an employee ch..

so.py
'recursion' 태그의 글 목록