썸네일 [leetCode] 14. Longest Common Prefix (Easy) 풀이 ❓ 문제 Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". 문자열 배열 중에서 가장 긴 공통 접두어를 찾는 함수를 작성하세요 만약 공통 접두어가 없다면, 빈 문자열 ""을 반환시키세요. Example1 Input: strs = ["flower","flow","flight"] Output: "fl" Example2 Input: strs = ["dog","racecar","car"] Output: "" Explanation: There is no common prefix among the input st..
썸네일 [leetCode] 13. Roman to Integer (Easy) 풀이 ❓ 문제 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. 로마 숫자는 7개의 다른 기호로 표시됩니다.: I, V, X, L, C, D 그리고 'M'. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II. 예를 들어, 2는 로마 숫자로 II로 표기되..
썸네일 [leetCode] 9. Palindrome Number (Easy) 풀이 ❓ 문제 Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is a palindrome while 123 is not. 주어진 정수형 x 가 회문(역순으로 읽어도 같은 말이나 구절 또는 숫자)이면 true를 반환하세요. 예를 들어, 121은 회문이고, 123은 회문이 아닌 것입니다. Example 1 Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left. Example ..
썸네일 [leetCode] 1. Two Sum (Easy) 풀이 ❓ 문제 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. 정수 배열 nums 와 정수 대상이 주어지면 두 숫자의 인덱스를 반환하여 대상에 합산되도록 합니다. 각 입력에 정확히 하나의 솔루션이 있다고 가정하고 동일한 요소를 두 번 사용하지 않을 수 있습니다. 어떤 순서로든 답변을..