leetcode2 [leetcode]50. Pow(x, n)문제풀이 # 문제 원문 Implement pow(x, n), which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.00000 Example 2: Input: x = 2.10000, n = 3 Output: 9.26100 Example 3: Input: x = 2.00000, n = -2 Output: 0.25000 Explanation: 2-2 = 1/22 = 1/4 = 0.25 # 문제 풀이 거듭제곱을 직접 구현하는 문제 언어 마다 거듭 제곱 관련한 연산자를 제공한다. 연산자가 처리하는 로직을 직접 구현해보는게 목적인 문제로 보인다. 문제풀이 방법은 DP, 재귀를 이용한 방식으로 .. 2021. 6. 27. [Leetcode]49. Group Anagrams 문제 풀이 # 문제 원문 Given an array of strings strs, group the anagrams together. You can return the answer in any order. 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. Example 1: Input: strs = ["eat","tea","tan","ate","nat","bat"] Output: [["bat"],["nat","tan"],["ate","eat","tea"]] Example 2: Input: strs .. 2021. 6. 26. 이전 1 다음