알고리즘

알고리즘/자료구조

[LeetCode] 155. Min Stack - Java

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 문제 더보기 Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Im..

알고리즘/자료구조

[LeetCode] 21. Merge Two Sorted Lists - Java

Merge Two Sorted Lists - LeetCode Can you solve this real interview question? Merge Two Sorted Lists - You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists leetcode.com 문제 더보기 You are given the heads of two sorted linked lists list1 and list2. Merge the two lists..

알고리즘/자료구조

[LeetCode] 2. Add Two Numbers - Java

Add Two Numbers - LeetCode Can you solve this real interview question? Add Two Numbers - You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and leetcode.com 문제 더보기 You are given two non-empty linked lists representing two non-negative integers. The digits are..

알고리즘/자료구조

[LeetCode] 141. Linked List Cycle - Java

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 문제 더보기 Given head, the head of a linked list, determine if the linked list has a cycle in it. There..

알고리즘/자료구조

[LeetCode] 3. Longest Substring Without Repeating Characters - Java

Longest Substring Without Repeating Characters - LeetCodeCan you solve this real interview question? Longest Substring Without Repeating Characters - Given a string s, find the length of the longest substring without repeating characters.   Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "leetcode.com 문제더보기Given a string s, find the length of the longest substring without r..

알고리즘/자료구조

[LeetCode] 209. Minimum Size Subarray Sum - Java

Minimum Size Subarray Sum - LeetCode Can you solve this real interview question? Minimum Size Subarray Sum - Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no such subarr leetcode.com 문제 더보기 Given an array of positive integers nums and a positive integer target, return the m..

알고리즘/자료구조

[LeetCode] 125. Valid Palindrome - Java

Valid Palindrome - LeetCode Can you solve this real interview question? Valid Palindrome - A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric cha leetcode.com 문제 더보기 A phrase is a palindrome if, after converting all uppercase letters into lowercase letters an..

알고리즘/자료구조

[LeetCode] 189. Rotate Array - Java

Rotate Array - LeetCode Can you solve this real interview question? Rotate Array - Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 step leetcode.com 문제 더보기 Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Exam..

알고리즘/자료구조

[LeetCode] 55. Jump Game - Java

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 문제 더보기 You are given an integer array nums. You are initially positioned at the array's first index, and ea..

알고리즘/자료구조

[LeetCode] 122. Best Time to Buy and Sell Stock II - Java

Best Time to Buy and Sell Stock II - LeetCode Can you solve this real interview question? Best Time to Buy and Sell Stock II - You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. You can only hold leetcode.com 문제 더보기 You are given an integer array prices where prices[i] is the price of a giv..

jny0
'알고리즘' 카테고리의 글 목록 (2 Page)