Algorithm/Brute Force (153) 썸네일형 리스트형 (C++) - LeetCode (easy) 1385. Find the Distance Value Between Two Arrays https://leetcode.com/problems/find-the-distance-value-between-two-arrays/description/ Find the Distance Value Between Two Arrays - LeetCode Can you solve this real interview question? Find the Distance Value Between Two Arrays - Given two integer arrays arr1 and arr2, and the integer d, return the distance value between the two arrays. The distance value is defined as the number of elements ar l.. (C++) - LeetCode (easy) 1380. Lucky Numbers in a Matrix https://leetcode.com/problems/lucky-numbers-in-a-matrix/description/ 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 정답 vector luckies, 행 r, 열 c를 선언 후 적절히 초기화해줍니다. 📔 풀이과정 matrix의 모든 원소를 조사하며 매 원소마다 다음을 수행합니다. 1. 현재 행에서 가장 작은 값을 minRowNum에 저장해줍니다. 2. 현재 열에서 가장 큰 값을 maxRowNum에 저장해줍니다. 3. maxRowNum, minRowNum이 같다면 lucky number이므로 luckies 배열에 현재 원소를 push_back해줍니다. 📔 정답 출력 | 반환 luckies를 반환합니다. 📕 Code 📔 C++ class Solu.. (C++) - LeetCode (easy) 997. Find the Town Judge https://leetcode.com/problems/find-the-town-judge/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 i번째 사람을 믿는 사람 수를 세기 위한 vector trusted와 i번째가 믿는 사람이 존재하는지 여부를 저장할 vector isTrust를 .. (C++) - LeetCode (easy) 812. Largest Triangle Area https://leetcode.com/problems/largest-triangle-area/description/ 📕 풀이방법 📔 입력 및 초기화 정답변수 maxArea 를 선언 후 0으로 초기화해줍니다. 📔 풀이과정 점 3개의 좌표를 알고 있다면 사선공식을 사용해 삼각형 면적을 구할 수 있으므로 3차원 for loop를 수행하며 최대 삼각형 면적을 구해 maxArea 📔 정답 출력 | 반환 maxArea를 반환합니다. 📕 Code 📔 C++ struct Point { int x,y; }; class Solution { public: double getTriangleArea(Point a, Point b, Point c){ return abs((a.x*b.y + b.x*c.y + c.x*a.y) - (.. (C++) - LeetCode (easy) 804. Unique Morse Code Words https://leetcode.com/problems/unique-morse-code-words/description/ (C++) - LeetCode (easy) 796. Rotate String https://leetcode.com/problems/rotate-string/description/ Rotate String - LeetCode Can you solve this real interview question? Rotate String - Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift on s consists of moving the leftmost character of s to the rightmost position. leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 풀이과정 1. 왼쪽으로 x칸만큼 움직인 문자열.. (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) 599. Minimum Index Sum of Two Lists https://leetcode.com/problems/minimum-index-sum-of-two-lists/description/ Minimum Index Sum of Two Lists - LeetCode Can you solve this real interview question? Minimum Index Sum of Two Lists - Given two arrays of strings list1 and list2, find the common strings with the least index sum. A common string is a string that appeared in both list1 and list2. A common string w leetcode.com 전수조사로 푼 문제였습.. 이전 1 ··· 3 4 5 6 7 8 9 ··· 20 다음