Problem Solving/LeetCode18 [LeetCode] 27. Remove Element - Java • 문제 링크 Remove Element - LeetCodeCan you solve this real interview question? Remove Element - Given an integer array nums and an integer val, remove all occurrences of val in nums in-place [https://en.wikipedia.org/wiki/In-place_algorithm]. The order of the elements may be changed. Then rleetcode.com • 풀이 코드public class Solution { public int removeElement(int[] nums, int val) { int idx.. 2026. 5. 15. [LeetCode] 26. Remove Duplicates from Sorted Array - Java • 문제 링크 Remove Duplicates from Sorted Array - LeetCodeCan you solve this real interview question? Remove Duplicates from Sorted Array - Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place [https://en.wikipedia.org/wiki/In-place_algorithm] such that each unique element apleetcode.com • 풀이 코드public class Solution { public int removeDuplicates(int[] nums) {.. 2026. 5. 14. [LeetCode] 21. Merge Two Sorted Lists - Java • 문제 링크 Merge Two Sorted Lists - LeetCodeCan 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 listsleetcode.com • 풀이 코드public class Solution { public ListNode mergeTwoLists(ListNode list1, ListNode.. 2026. 5. 13. [LeetCode] 20. Valid Parentheses - Java • 문제 링크 Valid Parentheses - LeetCodeCan 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 samleetcode.com • 풀이 코드public class Solution { public boolean isValid(String s) { char[] stk = new .. 2026. 5. 12. [LeetCode] 14. Longest Common Prefix - Java • 문제 링크 Longest Common Prefix - LeetCodeCan you solve this real interview question? Longest Common Prefix - Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: strs = ["flower","flow"leetcode.com • 풀이 코드public class Solution { public String longestCommonPrefix(String[] strs) { .. 2026. 5. 11. [LeetCode] 13. Roman to Integer - Java • 문제 링크 Roman to Integer - LeetCodeCan you solve this real interview question? Roman to Integer - Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just twleetcode.com • 풀이 코드public class Solution { public int romanToInt(String s) { int[] arr = {0, 0, 100.. 2026. 5. 10. 이전 1 2 3 다음