본문 바로가기

전체 글

(2344)
(C++) - LeetCode (easy) 507. Perfect Number https://leetcode.com/problems/perfect-number/description/ Perfect Number - LeetCode Can you solve this real interview question? Perfect Number - A perfect number [https://en.wikipedia.org/wiki/Perfect_number] is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. A divisor of an integer x is leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 제한이 1천만이므로 O(n..
(C++) - LeetCode (easy) 506. Relative Ranks https://leetcode.com/problems/relative-ranks/description/ Relative Ranks - LeetCode Can you solve this real interview question? Relative Ranks - You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique. The athletes are placed based on their leetcode.com 자료구조 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. 정답 vector ..
(C++) - LeetCode (easy) 504. Base 7 https://leetcode.com/problems/base-7/description/ Base 7 - LeetCode Can you solve this real interview question? Base 7 - Given an integer num, return a string of its base 7 representation. Example 1: Input: num = 100 Output: "202" Example 2: Input: num = -7 Output: "-10" Constraints: * -107
(C++) - LeetCode (easy) 500. Keyboard Row https://leetcode.com/problems/find-mode-in-binary-search-tree/description/ Find Mode in Binary Search Tree - LeetCode Can you solve this real interview question? Find Mode in Binary Search Tree - Given the root of a binary search tree (BST) with duplicates, return all the mode(s) [https://en.wikipedia.org/wiki/Mode_(statistics)] (i.e., the most frequently occurred element leetcode.com tree 순회 문제..
(C++) - LeetCode (easy) 500. Keyboard Row https://leetcode.com/problems/keyboard-row/description/ Keyboard Row - LeetCode Can you solve this real interview question? Keyboard Row - Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American keyboard like the image below. In the American keyboard: * the first ro leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 1. 첫 째, 둘 째, 셋 째 ..
(C++) - LeetCode (easy) 496. Next Greater Element I https://leetcode.com/problems/next-greater-element-i/description/ Next Greater Element I - LeetCode Can you solve this real interview question? Next Greater Element I - The next greater element of some element x in an array is the first greater element that is to the right of x in the same array. You are given two distinct 0-indexed integer arrays nums1 leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기..
(C++) - LeetCode (easy) 495. Teemo Attacking.cpp https://leetcode.com/problems/teemo-attacking/description/ Teemo Attacking - LeetCode Can you solve this real interview question? Teemo Attacking - Our hero Teemo is attacking an enemy Ashe with poison attacks! When Teemo attacks Ashe, Ashe gets poisoned for a exactly duration seconds. More formally, an attack at second t will mean Ashe is leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 ashe가 독에 당한 전체..
(C++) - LeetCode (easy) 492. Construct the Rectangle https://leetcode.com/problems/construct-the-rectangle/description/ Construct the Rectangle - LeetCode Can you solve this real interview question? Construct the Rectangle - A web developer needs to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L and leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화..