본문 바로가기

전체 글

(46)
[알고리즘] LeetCode 1102번 "Path With Maximum Minimum Value" (C/C++) - Don 임베디드 문제요약: Given an M x N integer matrix, return the maximum bandwidth of a path starting at (0,0) and ending at (M-1, N-1) moving in the 4 cardinal direstions. The maximum bandwidth of a path is the minimum value in that path. 제약: M == Row N == Column 1
[알고리즘] LeetCode 49번 "Group Anagrams" (C/C++) - Don 임베디드 문제요약: Given an array of strings strs, group the anagrams together and return the array of groups. The order of the group does not matter. An anagram is a word formed by rearranging the letters of a different word, typically using all the original letters only once. 제약: 1
[알고리즘] LeetCode 703번 "Kth Largest Element in a Stream" (C/C++) - Don 임베디드 문제요약: Implement KthLargest class that finds the Kth largest element in a stream. 1. Constructor KthLargest(int k, int [] nums) Initialize the object with K value and stream of integers nums. 2. int add(int val) Appends the integer val to the stream and returns the Kth largest element 제약: 1
[알고리즘] LeetCode 102번 "Binary Tree Level Order Traversal" (C/C++) - Don 임베디드 문제요약: Given the root of a binary tree, return the level order traversal of node values. (left to right, root to leaf, level by level). 제약: num of nodes in the tree [0,2000] -1000 val); } } if (curNode->left != NULL) { // push left node to the queue with level+1 value. leftVal = curNode->left->val; Q.push(make_pair(curNode->left, level+1)); } if (curNode->right != NULL) { // push right node to th..
[알고리즘] LeetCode 268번 "Missing Number" (C/C++) - Don 임베디드 문제요약: Given an array nums containing n distinct numbers in the range [0,n], return the only number in the range that is missing from the array. 제약: n = nums.size() 1
[알고리즘] LeetCode 252번 "Meeting Rooms" (C/C++) - Don 임베디드 문제요약: Given a 2D vector intervals, which is a vector of meeting time vectors {start_time, end_time}, determine if a person could attend all meetings. 제약: 0
[알고리즘] LeetCode 66번 "Plus One" (C/C++) - Don 임베디드 문제요약: When given array of integers called digits, that presents decimal digits one by one, return the result of the (number + 1) in the same format. Digits[i] represent the ith digit of a number. Digits are ordered from most significant to least significant in left-to-right order. The digits does not contain any leading 0's. 제약: 1
[알고리즘] LeetCode 202번 "Happy Number" (C/C++) - Don 임베디드 문제요약: Write an algorithm that determines if a number n is a "happy number" A happy number is defined as the following process. - Starting with any positive number, replace the number by the sum of the squares of its digits. - Repeat the process until the number equals 1, or it loops endlessly in a cycle which does not include 1. - THose numbers for which this process ends in 1 are happy. return ..