본문 바로가기

전체 글

(2344)
(C++) - LeetCode (easy) 671. Second Minimum Node In a Binary Tree https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/description/ Second Minimum Node In a Binary Tree - LeetCode Can you solve this real interview question? Second Minimum Node In a Binary Tree - Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub leetcode.com ..
(C++) - LeetCode (easy) 653. Two Sum IV - Input is a BST https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/ Two Sum IV - Input is a BST - LeetCode Can you solve this real interview question? Two Sum IV - Input is a BST - Given the root of a binary search tree and an integer k, return true if there exist two elements in the BST such that their sum is equal to k, or false otherwise. Example 1: [http leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 입..
(C++) - LeetCode (easy) 661. Image Smoother https://leetcode.com/problems/image-smoother/ Image Smoother - LeetCode Can you solve this real interview question? Image Smoother - An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nin leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. img의 행 수 r, 열 수 c를 선언 후 ..
(C++) - LeetCode (easy) 657. Robot Return to Origin https://leetcode.com/problems/robot-return-to-origin/description/ Robot Return to Origin - LeetCode Can you solve this real interview question? Robot Return to Origin - There is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves. You are giv leetcode.com simulation 문제였습니다. 📕 풀이방법 📔 ..
(C++) - LeetCode (easy) 645. Set Mismatch https://leetcode.com/problems/set-mismatch/description/ Set Mismatch - LeetCode Can you solve this real interview question? Set Mismatch - You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to another number in the set, which res leetcode.com 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. nums의 원소와 그 빈도수를 ..
(C++) - LeetCode (easy) 643. Maximum Average Subarray I https://leetcode.com/problems/maximum-average-subarray-i/description/ Maximum Average Subarray I - LeetCode Can you solve this real interview question? Maximum Average Subarray I - You are given an integer array nums consisting of n elements, and an integer k. Find a contiguous subarray whose length is equal to k that has the maximum average value and return thi leetcode.com 누적합으로 해결한 문제였습니다. 📕 ..
(C++) - LeetCode (easy) 705. Design HashSet https://leetcode.com/problems/design-hashset/description/ Design HashSet - LeetCode Can you solve this real interview question? Design HashSet - Design a HashSet without using any built-in hash table libraries. Implement MyHashSet class: * void add(key) Inserts the value key into the HashSet. * bool contains(key) Returns whether the value leetcode.com class를 구현해보는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 set을 ..
(C++) - LeetCode (easy) 637. Average of Levels in Binary Tree https://leetcode.com/problems/average-of-levels-in-binary-tree/description/ Average of Levels in Binary Tree - LeetCode Can you solve this real interview question? Average of Levels in Binary Tree - Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10-5 of the actual answer will be accepted. Examp leetcode.com bfs 로 해결한 문..