본문 바로가기

분류 전체보기

(1937)
(C++) - LeetCode (easy) 1389. Create Target Array in the Given Order https://leetcode.com/problems/create-target-array-in-the-given-order/description/ Create Target Array in the Given Order - LeetCode Can you solve this real interview question? Create Target Array in the Given Order - Given two arrays of integers nums and index. Your task is to create target array under the following rules: * Initially target array is empty. * From left to right read n leetcode.c..
(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) 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/description/ Find a Corresponding Node of a Binary Tree in a Clone of That Tree - LeetCode Can you solve this real interview question? Find a Corresponding Node of a Binary Tree in a Clone of That Tree - Given two binary trees original and cloned and given a reference to a node target in the original..
(SQL) - LeetCode (easy) 1378. Replace Employee ID With The Unique Identifier https://leetcode.com/problems/replace-employee-id-with-the-unique-identifier/ Replace Employee ID With The Unique Identifier - LeetCode Can you solve this real interview question? Replace Employee ID With The Unique Identifier - Table: Employees +---------------+---------+ | Column Name | Type | +---------------+---------+ | id | int | | name | varchar | +---------------+---------+ id is t leetc..
(C++) - LeetCode (easy) 1374. Generate a String With Characters That Have Odd Counts https://leetcode.com/problems/generate-a-string-with-characters-that-have-odd-counts/description/ Generate a String With Characters That Have Odd Counts - LeetCode Can you solve this real interview question? Generate a String With Characters That Have Odd Counts - Given an integer n, return a string with n characters such that each character in such string occurs an odd number of times. The retu..
(C++) - LeetCode (easy) 1370. Increasing Decreasing String https://leetcode.com/problems/increasing-decreasing-string/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 구현문제였습니다. 📕 풀이방법 📔 입력 및 초기화 정답 변수 res, alphabat별 빈도수 freq를 선언 후 값을 구해 저장 해줍니다. 📔 풀이과정 res가 s길이보다 적은 동안 ..
(C++) - LeetCode (easy) 1365. How Many Numbers Are Smaller Than the Current Number https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number/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 간단 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 정답 vector ans를 선언해줍니다. 📔 풀이과정 nums의 원소를 순회하며 자신..