๊ฐœ๋ฐœ/๐Ÿค– ์•Œ๊ณ ๋ฆฌ์ฆ˜ 43

[leetcode][Easy][LinkedList] 206. Reverse Linked List ํ’€์ด, ํ•ด์„ค

๋ฌธ์ œ๋งํฌ : https://leetcode.com/problems/reverse-linked-list/ Reverse Linked List - LeetCode Can you solve this real interview question? Reverse Linked List - Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: [https://assets.leetcode.com/uploads/2021/02/19/rev1ex1.jpg] Input: head = [1,2,3,4,5] O leetcode.com ํ’€์ด # Definition for singly-linked list. # ..

[leetcode][Medium][Stack] 739. Daily Temperatures ํ’€์ด, ํ•ด์„ค (python)

https://leetcode.com/problems/daily-temperatures/ Daily Temperatures - LeetCode Can you solve this real interview question? Daily Temperatures - Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer leetcode.com 1์ฐจ ํ’€์ด class Solution(object): def dailyTemperatur..

[leetcode][Medium][Stack] 22. Generate Parentheses ํžŒํŠธ, ํ’€์ด, ํ•ด์„ค (python)

https://leetcode.com/problems/generate-parentheses/ 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 ํžŒํŠธ https://www.youtube.com/watch?v=s9fokUqJ76A ..

[leetcode][Medium][Stack] 150. Evaluate Reverse Polish Notation ํ’€์ด, ํ•ด์„ค (python)

https://leetcode.com/problems/evaluate-reverse-polish-notation/ Evaluate Reverse Polish Notation - LeetCode Can you solve this real interview question? Evaluate Reverse Polish Notation - You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation [http://en.wikipedia.org/wiki/Reverse_Polish_notation]. Evaluate t leetcode.com 1์ฐจ ํ’€์ด class Solution..

[leetcode][Medium][Stack] 155. Min Stack ํ’€์ด, ํ•ด์„ค (python)

https://leetcode.com/problems/min-stack/ Min Stack - LeetCode Can you solve this real interview question? Min Stack - Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: * MinStack() initializes the stack object. * void push(int val) pushes t leetcode.com 1์ฐจ ํ’€์ด ๊ฐ€๋ฒผ์šด ์Šคํƒ ๋ฌธ์ œ์ผ๊ฑฐ๋ผ ์ƒ๊ฐํ–ˆ๋Š”๋ฐ, getMin ๋ถ€๋ถ„์—์„œ ์–ด๋–ป๊ฒŒ O(1)์„ ๋งŒ๋“ค๊นŒ ์ž ๊น ๊ณ ๋ฏผํ–ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‹ค๊ฐ€ ..

[leetcode][Easy][Stack] 20. Valid Parentheses ํ’€์ด, ํ•ด์„ค (python)

https://leetcode.com/problems/valid-parentheses/ Valid Parentheses - LeetCode Can you solve this real interview question? Valid Parentheses - Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 1. Open brackets must be closed by the sam leetcode.com 1์ฐจ ํ’€์ด ๋‹จ์ˆœํ•œ ์Šคํƒ ๋ฌธ์ œ๋ผ ๊ฐ„๋‹จํžˆ ํ’€์—ˆ์ง€๋งŒ, ์กฐ๊ฑด์ด ์ถ”๊ฐ€๊ฐ€ ๋˜๋ฉด์„œ ์ข€ ๋ณต์žกํ•œ ํ’€์ด๊ฐ€ ๋˜..

[leetcode][Hard][Two Pointers] 42. Trapping Rain Water ํ’€์ด, ํ•ด์„ค (python) : ํ•ด์„ค ์ฐธ๊ณ ํ•ด์„œ ํ‘ผ ํ’€์ด

https://leetcode.com/problems/trapping-rain-water/ Trapping Rain Water - LeetCode Can you solve this real interview question? Trapping Rain Water - Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: [https://assets.leetcode.com/upl leetcode.com ํ•œ์‹œ๊ฐ„ ์ •๋„ ํ’€๋ฆด๊นŒ ๋ง๊นŒ ํ•˜๋‹ค๊ฐ€, ํ’€๋ฆฌ์ง€ ์•Š์•„์„œ ... ๊ฒฐ๊ตญ ํ•ด์„ค์„ ๋ณธ ํ’€์ด์ด๋‹ค. ์ผ๋‹จ,..

[leetcode][Medium][Two Pointers] 11. Container With Most Water ํ’€์ด, ํ•ด์„ค (python)

https://leetcode.com/problems/container-with-most-water/ Container With Most Water - LeetCode Can you solve this real interview question? Container With Most Water - You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that toget leetcode.com 1์ฐจ ํ’€์ด ์ผ๋‹จ ๋‹จ์ˆœํ•˜๊ฒŒ, O(n^2)๋กœ ์ ‘๊ทผํ–ˆ๋‹ค. ๊ทธ๋žฌ๋”๋‹ˆ ..

[leetcode] 15. 3Sum ํ’€์ด, ํ•ด์„ค (python)

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 1์ฐจ ํ’€์ด ์ ‘๊ทผ๋ฒ•์„ ๋ชป์ฐพ์•„์„œ O(n*n)์œผ๋กœ ํ‘ธ๋Š” ๋ฐฉ๋ฒ•์„ ์‹œ๋„ํ–ˆ๋‹ค. a,b๋ฅผ ์ฐพ์•„์„œ -(a + b)๊ฐ’์ด ๋‹ค๋ฅธ ๋ฐฐ์—ด์•ˆ์— ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๋ฐฉ..

[leetcode] 167. Two Sum II - Input Array Is Sorted ํ’€์ด, ํ•ด์„ค (python)

๋ฌธ์ œ ๋งํฌ https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ Two Sum II - Input Array Is Sorted - LeetCode Can you solve this real interview question? Two Sum II - Input Array Is Sorted - Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two n leetcode.com 1์ฐจ ํ’€์ด ๋‹จ์ˆœํ•˜๊ฒŒ ๋ชจ..

๋ฐ˜์‘ํ˜•