본문 바로가기

Algorithm/Implementation

(517)
(C++) - LeetCode (easy) 1342. Number of Steps to Reduce a Number to Zero https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/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 간단 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 정답 변수 cnt를 선언 후 0으로 초기화해줍니다. 📔 풀이과정 num이 0이 아닌 동안 while l..
(C++) - LeetCode (easy) 1332. Remove Palindromic Subsequences https://leetcode.com/problems/remove-palindromic-subsequences/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 간단 구현문제였습니다. 📕 풀이방법 📔 풀이과정 모든 문자열은 a또는 b로만 이루어져 있고 부분 문자열은 순서 상관 없이 고를 수 있으므로 최악의 횟수는 a, b각각 모아 지우는 ..
(SQL) - LeetCode (easy) 1327. List the Products Ordered in a Period https://leetcode.com/problems/list-the-products-ordered-in-a-period/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 join, group by, 조건절을 사용해본 문제였습니다. 📕 풀이방법 📔 풀이과정 1. products와 orders를 product_id에 대해 join합니다.2...
(C++) - LeetCode (easy) 1323. Maximum 69 Number https://leetcode.com/problems/maximum-69-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 간단 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 num을 문자열로 바꿔서 numString에 저장해줍니다. 📔 풀이과정 가장 큰 수를 만드는 법은 6이 처음나온 부분을 9로 바꿔준 후 numStr..
(C++) - LeetCode (easy) 1317. Convert Integer to the Sum of Two No-Zero Integers https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers/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 간단 구현 문제였습니다. 📕 풀이방법 📔 풀이과정 1 ~ n/2까지 for loop를 수행하면서 i 와 n - i에 0이 포함되어있는지 확인해 정..
(C++) - LeetCode (easy) 1313. Decompress Run-Length Encoded List https://leetcode.com/problems/decompress-run-length-encoded-list/ 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의 원소를 순회하며 freq와 val을 저장해 freq만큼 val을 ans에 ..
(C++) - LeetCode (easy) 1304. Find N Unique Integers Sum up to Zero https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/ 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를 선언해줍니다. 📔 풀이과정 고유한 숫자에 부호만 나누어 ans에 분배해주면 됩니다. 짝수인 경우 부호만 다르게 고루 분배하면 되지만..
(C++) - LeetCode (easy) 1295. Find Numbers with Even Number of Digits https://leetcode.com/problems/find-numbers-with-even-number-of-digits/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 간단 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 자리수가 짝수인 개수를 셀 변수 evenNumberCount를 선언해줍니다. 📔 풀이과정 nums의 원소를 ..