개발/Leetcode
-
Leetcode 137. Single Number II개발/Leetcode 2023. 7. 4. 09:11
https://leetcode.com/problems/single-number-ii/description/ Single Number II - LeetCode Can you solve this real interview question? Single Number II - Given an integer array nums where every element appears three times except for one, which appears exactly once. Find the single element and return it. You must implement a solution with a lin leetcode.com 문제 정수 배열인 nums가 주어진다. 이 배열은 한 원소만 정확히 한번만 ..
-
Leetcode 859. Buddy Strings개발/Leetcode 2023. 7. 3. 10:48
https://leetcode.com/problems/buddy-strings/ Buddy Strings - LeetCode Can you solve this real interview question? Buddy Strings - Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false. Swapping letters is defined as taking two indices i and j (0-ind leetcode.com 문제 문자열 s와 goal이 주어진다. 이때 s의 문자 중 하나만 바꿔 goal과 같아진다면 True를 ..
-
Leetcode 2114. Maximum Number of Words Found in Sentences개발/Leetcode 2023. 7. 2. 10:54
https://leetcode.com/problems/maximum-number-of-words-found-in-sentences/description/ Maximum Number of Words Found in Sentences - LeetCode Can you solve this real interview question? Maximum Number of Words Found in Sentences - A sentence is a list of words that are separated by a single space with no leading or trailing spaces. You are given an array of strings sentences, where each sentenc le..
-
Leetcode 1678. Goal Parser Interpretation개발/Leetcode 2023. 7. 2. 10:45
https://leetcode.com/problems/goal-parser-interpretation/description/ 문제 당신은 주어지는 command를 해석하는 Goal Parser의 주인이다. command는 "G", "()" 그리고 "(al)"로 이루어져 있다. Goal Parer는 "G"는 "G" 그대로 해석하고, "()"는 "o"로 해석한다. 마지막으로 "(al)"은 "al"로 해석한다. 주어진 command를 위와같이 해석하여 반환하여라 코드 import re class Solution: def interpret(self, command: str) -> str: # () parse answer = "" answer = re.sub(r'\(\)', 'o', command) # (al) ..
-
Leetcode 744. Find Smallest Letter Greater Than Target개발/Leetcode 2023. 7. 2. 10:38
https://leetcode.com/problems/find-smallest-letter-greater-than-target/description/ Find Smallest Letter Greater Than Target - LeetCode Can you solve this real interview question? Find Smallest Letter Greater Than Target - You are given an array of characters letters that is sorted in non-decreasing order, and a character target. There are at least two different characters in letters. Retu leetc..
-
Leetcode 2011. Final Value of Variable After Performing Operations개발/Leetcode 2023. 7. 2. 10:33
https://leetcode.com/problems/final-value-of-variable-after-performing-operations/description/ Final Value of Variable After Performing Operations - LeetCode Can you solve this real interview question? Final Value of Variable After Performing Operations - There is a programming language with only four operations and one variable X: * ++X and X++ increments the value of the variable X by 1. * --X..
-
Leetcode 43. Multiply Strings개발/Leetcode 2023. 7. 1. 11:36
https://leetcode.com/problems/multiply-strings/description/ Multiply Strings - LeetCode Can you solve this real interview question? Multiply Strings - Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger library leetcode.com 문제 양의 정수인 num1과 num2가 주어지며 이 숫자들은 문자열로 표현되..
-
Leetcode 22. Generate Parentheses개발/Leetcode 2023. 7. 1. 10:36
https://leetcode.com/problems/generate-parentheses/description/ Generate Parentheses - LeetCode Can you solve this real interview question? Generate Parentheses - Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Exa leetcode.com 문제 n개의 괄호 짝으로 만들 수 있는 모든 괄호을 반환하여라 ..