[LeetCode]Search in Rotated Sorted Array
·
SW개발/코딩테스트
https://leetcode.com/problems/search-in-rotated-sorted-array/ Search in Rotated Sorted Array - LeetCode Can you solve this real interview question? Search in Rotated Sorted Array - There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 int: left = 0 right = len(nums)-1 while ..
[LeetCode]Next Permutation
·
SW개발/코딩테스트
https://leetcode.com/problems/next-permutation/description/ Next Permutation - LeetCode Can you solve this real interview question? Next Permutation - A permutation of an array of integers is an arrangement of its members into a sequence or linear order. * For example, for arr = [1,2,3], the following are all the permutations of arr: [1,2,3], leetcode.com 문제 분석 숫자가 주어졌을 때 다음 순열을 찾는 문제입니다. 처음 시도한..
[LeetCode]Linked List Cycle
·
SW개발/코딩테스트
https://leetcode.com/problems/linked-list-cycle/ Linked List Cycle - LeetCode Can you solve this real interview question? Linked List Cycle - Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the list that can be reached again by continuo leetcode.com 문제 분석 주어진 링크드 리스트에 사이클이 존재하는지 여부를 구하는 문제입니다. 처음 시도..
[LeetCode]Single Number
·
SW개발/코딩테스트
https://leetcode.com/problems/single-number/ Single Number - LeetCode Can you solve this real interview question? Single Number - Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linear runtime complexity and use only constant leetcode.com 문제 분석 주어진 nums 리스트에서 한번만 등장하는 숫자를 찾는 문제입니다. 처음 시도한 답안 class So..
[LeetCode]Best Time to Buy and Sell Stock
·
SW개발/코딩테스트
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Best Time to Buy and Sell Stock - LeetCode Can you solve this real interview question? Best Time to Buy and Sell Stock - You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosin leetcode.com 문제 분석 주식에 대한 가격이 주어졌을 ..
[LeetCode]Swap Nodes in Pairs
·
SW개발/코딩테스트
https://leetcode.com/problems/swap-nodes-in-pairs/ Swap Nodes in Pairs - LeetCode Can you solve this real interview question? Swap Nodes in Pairs - Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only nodes themselves may be chan leetcode.com 문제 분석 서로 인접해있는 노드를 뒤집는 문제입니다. 단, 값을 바꾸는 것이 아니라 링..
[LeetCode]Generate Parentheses
·
SW개발/코딩테스트
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개의 괄호를 가지고 가능한 괄호의 조합을 모..
[LeetCode]Remove Nth Node From End of List
·
SW개발/코딩테스트
https://leetcode.com/problems/remove-nth-node-from-end-of-list/ Remove Nth Node From End of List - LeetCode Can you solve this real interview question? Remove Nth Node From End of List - Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: [https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg] leetcode.com 문제 분석 주어진 링크드 리스트에서 뒤에서 ..
[LeetCode]Letter Combinations of a Phone Number
·
SW개발/코딩테스트
https://leetcode.com/problems/letter-combinations-of-a-phone-number/ Letter Combinations of a Phone Number - LeetCode Can you solve this real interview question? Letter Combinations of a Phone Number - Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of d leetcode.com 문제 분석 번호가 ..
[LeetCode]3Sum
·
SW개발/코딩테스트
https://leetcode.com/problems/3sum/ 3Sum - LeetCode Can you solve this real interview question? 3Sum - Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain du leetcode.com 문제 분석 합이 0이되는 3개의 숫자를 구하는 문제입니다. 중복된 숫자의 사용이 있다면 제외합니다. 처음 시도한 답안 (오답) impor..