개발공부/algorithm

개발공부/algorithm

[Leetcode][python] 257: binary tree paths - DFS

Leetcode 257 Binary tree paths Level: Easy Link Binary Tree Paths - 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 Classic dfs problem with a tree data structure Check if a root has left or right leaf If either the left or right leaf exists: perform dfs recursively wit..

개발공부/algorithm

[Leetcode][python] 733: flood fill - bfs

Leetcode 733: flood fill - bfs Level Easy Link Flood Fill - 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 Classic bfs problem with replacing existing values into the new value Locate the starting number and search through up, down, left, right index. Check if the new ..

개발공부/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
'개발공부/algorithm' 카테고리의 글 목록 (10 Page)