본문 바로가기

전체 글

(2344)
(C++) - LeetCode (easy) 551. Student Attendance Record I https://leetcode.com/problems/student-attendance-record-i/description/ Student Attendance Record I - LeetCode Can you solve this real interview question? Student Attendance Record I - You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or present on that day. The record only leetcode.com 구현 문제였습니다. 📕 풀이방법 📔..
(C++) - LeetCode (easy) 543. Diameter of Binary Tree https://leetcode.com/problems/diameter-of-binary-tree/description/ Diameter of Binary Tree - LeetCode Can you solve this real interview question? Diameter of Binary Tree - Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path leetcode.com 재귀함수를 이용해 답을 구하는 문제였습니다. 📕..
(C++) - LeetCode (easy) 541. Reverse String II https://leetcode.com/problems/reverse-string-ii/description/ Reverse String II - LeetCode Can you solve this real interview question? Reverse String II - Given a string s and an integer k, reverse the first k characters for every 2k characters counting from the start of the string. If there are fewer than k characters left, reverse all of them. leetcode.com 문자열을 다루는 문제였습니다. 📕 풀이방법 📔 풀이과정 2*k만큼 증..
(C++) - LeetCode (easy) 530. Minimum Absolute Difference in BST https://leetcode.com/problems/minimum-absolute-difference-in-bst/description/ Minimum Absolute Difference in BST - LeetCode Can you solve this real interview question? Minimum Absolute Difference in BST - Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. Example 1: [https://assets.l leetcode.com tree 순회..
(C++) - LeetCode (easy) 521. Longest Uncommon Subsequence I https://leetcode.com/problems/longest-uncommon-subsequence-i/description/ Longest Uncommon Subsequence I - LeetCode Can you solve this real interview question? Longest Uncommon Subsequence I - Given two strings a and b, return the length of the longest uncommon subsequence between a and b. If the longest uncommon subsequence does not exist, return -1. An uncommon subseq leetcode.com 문자열 문제였습니다. ..
(C++) - LeetCode (easy) 520. Detect Capital https://leetcode.com/problems/detect-capital/ Detect Capital - LeetCode Can you solve this real interview question? Detect Capital - We define the usage of capitals in a word to be right when one of the following cases holds: * All letters in this word are capitals, like "USA". * All letters in this word are not capitals, like leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 풀이과정 모두 대문자거나, 모두 소문자거나, 처음만 대문자인 ..
(SQL) - LeetCode (easy) 511. Game Play Analysis I https://leetcode.com/problems/game-play-analysis-i/description/ Game Play Analysis I - LeetCode Can you solve this real interview question? Game Play Analysis I - Table: Activity +--------------+---------+ | Column Name | Type | +--------------+---------+ | player_id | int | | device_id | int | | event_date | date | | games_played | int | +---------- leetcode.com group by를 사용해보는 문제였습니다. 📕 풀이방법 📔..
(C++) - LeetCode (easy) 509. Fibonacci Number https://leetcode.com/problems/fibonacci-number/description/ Fibonacci Number - LeetCode Can you solve this real interview question? Fibonacci Number - The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is, F(0) = 0 leetcode.com top down dp로 해결한 문제였습니다. 📕 풀이방법 📔 입력 및 초..