Algorithm/Implementation (750) 썸네일형 리스트형 (C++) - LeetCode (easy) 258. Add Digits https://leetcode.com/problems/add-digits/description/ Add Digits - LeetCode Add Digits - Given an integer num, repeatedly add all its digits until the result has only one digit, and return it. Example 1: Input: num = 38 Output: 2 Explanation: The process is 38 --> 3 + 8 --> 11 11 --> 1 + 1 --> 2 Since 2 has only one digit, retu leetcode.com simulation으로 해결한 문제였습니다. 📕 풀이방법 📔 풀이과정 자리수를 확인해 더해주기 위해.. (C++) - LeetCode (easy) 242. Valid Anagram https://leetcode.com/problems/valid-anagram/description/ Valid Anagram - LeetCode Valid Anagram - Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. E leetcode.com 간단 정렬 문제였습니다. 📕 풀이방법 📔 풀이과정 두 문자열을 사전순으로 정렬 후 같은지.. (C++) - LeetCode (easy) 228. Summary Ranges https://leetcode.com/problems/summary-ranges/description/ Summary Ranges - LeetCode Summary Ranges - You are given a sorted unique integer array nums. A range [a,b] is the set of all integers from a to b (inclusive). Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 풀이과정 정답 vector ans를 선언해줍.. (C++) - LeetCode (easy) 225. Implement Stack using Queues https://leetcode.com/problems/implement-stack-using-queues/description/ Implement Stack using Queues - LeetCode Implement Stack using Queues - Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and empty). Implement the MyStack class: * void push(int x) Pushes el leetcode.com class를 활용한 자료구조 .. (C++) - LeetCode (easy) 219. Contains Duplicate II https://leetcode.com/problems/contains-duplicate-ii/description/ Contains Duplicate II - LeetCode Contains Duplicate II - Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) (C++) - LeetCode (easy) 217. Contains Duplicate https://leetcode.com/problems/contains-duplicate/description/ Contains Duplicate - LeetCode Contains Duplicate - Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: fal leetcode.com map을 이용한 문제였습니다. 📕 풀이방법 📔 풀이과정 vector로 .. (C++) - LeetCode (easy) 171. Excel Sheet Column Number https://leetcode.com/problems/excel-sheet-column-number/description/ Excel Sheet Column Number - LeetCode 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 간단 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 정답 ans를 선언해줍니다. 📔 풀이과정 alphabat형태를 하고 있으므로 26진수임을 알 수 있습니다. 진법 계산을 columnTitle을 순회하며 완료 후 ans에 해당 자리에 해당하.. (C++) - LeetCode (easy) 168. Excel Sheet Column Title https://leetcode.com/problems/excel-sheet-column-title/description/ Excel Sheet Column Title - LeetCode 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 진법 구현 문제였습니다. 📕 풀이방법 📔 풀이과정 * alphabat형태로 자릿수가 늘어나므로 26진법이라고 생각 해봅시다. 1. 'A'가 1부터 시작하므로 0부터 시작하는 진법을 맞추기 위해 -1한 값의 26으로 나눈 나머지를 vector v에 p.. 이전 1 ··· 41 42 43 44 45 46 47 ··· 94 다음