recursion3 6 Recursive Pattern [출처] 6 Patterns Each pattern provides a basic framework one you understand the framework, you can fit all problems into one of these frameworks these patterns overlap extensively - find the pattern that works for you all patterns are based on basic recursive principles Index Iteration Breaking into Subproblems selection ordering divide and conquer depth-first search Iteration iterate over array/.. 2020. 9. 11. LeetCode - Fibonacci Number, Climbing Stairs 문제 The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is,F(0) = 0, F(1) = 1 F(N) = F(N - 1) + F(N - 2), for N > 1. Given N, calculate F(N). Example 1: Input: 2 Output: 1 Explanation: F(2) = F(1) + F(0) = 1 + 0 = 1. Example 2: Input: 3 Output: 2 Explanation: F(3) = F(2.. 2020. 9. 10. LeetCode - Reverse String Reverse String - 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 문제 Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) e.. 2020. 9. 3. 이전 1 다음