💡 LeetCode 58 - Length of Last Word
문제 Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. 입출력 예제 ✅ 예제 1 Input...
문제 Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. 입출력 예제 ✅ 예제 1 Input...
문제 Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write...
문제 Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 입출력 예제 ✅ 예제 1 Input: haystack = "sadbutsad", ...
문제 Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which ar...
문제 Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept t...
문제 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. Re...
문제 Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. An input string is valid if: Open brackets must be closed by th...
문제 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 “”. 입출력 예제 ✅ 예제 1 Input: strs = ["flower","flow",...
문제 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 ...
문제 Given an integer x, return true if x is a palindrome, and false otherwise. 입출력 예제 ✅ 예제 1 Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left....