[LeetCode]Jump Game
·
SW개발/코딩테스트
https://leetcode.com/problems/jump-game/ Jump Game - LeetCode Can you solve this real interview question? Jump Game - You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return true if you can leetcode.com 문제 분석 nums 배열이 주어졌을 때 마지막 index에 도달할 수 있는지를 구하는 문제입니다. 처음 시도한 답안 c..
[LeetCode]Spiral Matrix II
·
SW개발/코딩테스트
https://leetcode.com/problems/spiral-matrix-ii/ Spiral Matrix II - LeetCode Can you solve this real interview question? Spiral Matrix II - Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order. Example 1: [https://assets.leetcode.com/uploads/2020/11/13/spiraln.jpg] Input: n = 3 O leetcode.com 문제 분석 n의 값이 주어지는 n*n matrix에서 Sprial 순서대로 탐색을 했을 경우의 ma..
[LeetCode]Spiral Matrix
·
SW개발/코딩테스트
https://leetcode.com/problems/spiral-matrix/ Spiral Matrix - LeetCode Can you solve this real interview question? Spiral Matrix - Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: [https://assets.leetcode.com/uploads/2020/11/13/spiral1.jpg] Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Outpu leetcode.com 문제 분석 주어진 Grid를 시계 방향으로 달팽이 회전하듯이 탐색할 때 그 경로를 기록하는 문제입니다. 처음 ..
[LeetCode]Maximum Subarray
·
SW개발/코딩테스트
https://leetcode.com/problems/maximum-subarray/ Maximum Subarray - LeetCode Can you solve this real interview question? Maximum Subarray - Given an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: The subarray [4,-1,2,1] has t leetcode.com 문제 분석 주어진 nums 리스트에서 숫자들의 합이 최대가 되는 subarray를 구하는 문제입니다..
[LeetCode]Group Anagrams
·
SW개발/코딩테스트
https://leetcode.com/problems/group-anagrams/description/ Group Anagrams - LeetCode Can you solve this real interview question? 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 leetcode.com 문제 분석 주어진 문자열에서 동일한 anagram을 그룹화 하는 문제입니다. 처..
[LeetCode]Rotate Image
·
SW개발/코딩테스트
https://leetcode.com/problems/rotate-image/ Rotate Image - LeetCode Can you solve this real interview question? Rotate Image - You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place [https://en.wikipedia.org/wiki/In-place_algorithm], which m leetcode.com 문제 분석 주어진 이미지를 90도 시계방향으로 돌리는 경우 숫자가 어떻게 변해있는지를 구하는 문제입니다. 처..
[LeetCode]Permutations
·
SW개발/코딩테스트
https://leetcode.com/problems/permutations/ Permutations - LeetCode Can you solve this real interview question? Permutations - Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1], leetcode.com 문제 분석 주어진 숫자로 만들 수 있는 모든 순열을 구하는 문제입니다. 처음 시도한 답안 import iterto..
[LeetCode]Jump Game II
·
SW개발/코딩테스트
https://leetcode.com/problems/jump-game-ii/description/ Jump Game II - LeetCode Can you solve this real interview question? Jump Game II - You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0]. Each element nums[i] represents the maximum length of a forward jump from index i. In other wo leetcode.com 문제 분석 nums 리스트에는 한번에 점프할 수 있는 최대의 값이 들어 있습니다. 목적..
[LeetCode]Combination Sum
·
SW개발/코딩테스트
https://leetcode.com/problems/combination-sum/description/ Combination Sum - LeetCode Can you solve this real interview question? Combination Sum - Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the comb leetcode.com 문제 분석 주어진 숫자를 더해서 target 값을 만들어 낼 수 있는 숫자 ..
[LeetCode]Find First and Last Position of Element in Sorted Array
·
SW개발/코딩테스트
https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/ Find First and Last Position of Element in Sorted Array - LeetCode Can you solve this real interview question? Find First and Last Position of Element in Sorted Array - Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is no..