목록2024/01/10 (2)
넘치게 채우기
자바스크립트를 이용하여 현재 내 블로그에서 보고 있는 게시글의 카테고리, 또는 보고 있는 카테고리를 사이드바에서 강조 시켜보려고 한다. 아래처럼! 우선, 글을 볼 때 강조하는 방법과, 카테고리를 볼 때 강조하는 방법이 다르다. 현재 주소에서 블로그주소/category일때, 블로그주소/entry일때의 경우를 다르게 처리해주면 된다. 카테고리를 보고 있을 때 카테고리 불러오기 카테고리를 보고 있을 때의 현재 주소를 보자. 블로그주소/category/카테고리/서브카테고리 형식으로 되어 있다. 현재 카테고리를 알아내기 위해, 현재 URL에서 가져오면 될 것 같다! const curr_path = location.pathname; // /category/PS/Leetcode location.pathname을 통해..
https://leetcode.com/problems/amount-of-time-for-binary-tree-to-be-infected/description/ Amount of Time for Binary Tree to Be Infected - LeetCodeCan you solve this real interview question? Amount of Time for Binary Tree to Be Infected - You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from the node with value start. Each minute, a..