목록LeetCode (13)
개발자도전

[문제] You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's. Increment the large integer by one and return the resulting array of digits. 정수 배열의 맨 마지막 숫자에 1을 더해서 값을 반환하라. [입출력 예] Example 1..

[문제] 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 the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type. '(', ')', '{', '}', '[' , ']' 괄호로 이루어진 문자열이 해당 조건을 만족하면 true를 ..

[문제] 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. 주어진 문자열 s의 맨 마지막 단어의 길이를 return 시켜라. [입출력 예] Example 1: Input: s = "Hello World" Output: 5 Explanation: The last word is "World" with length 5. Example 2: Input: s = " fly me to the moon " Output: 4 Explanation: The last wo..

[문제] 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 an algorithm with O(log n) runtime complexity. 배열 중 target과 같은 값이 있다면 그 값을 return 시키고 그렇지 않다면 그 값이 어디에 들어갈 지 알아내라. [입출력 예] Example 1: Input: nums = [1,3,5,6], target = 5 Output: 2 Example 2: Input: nums..

[문제] 배열 안의 숫자들이 증가하다가 감소하는 모양이 산모양이 되어야 함. [입출력 예] Example 1: Input: arr = [2,1] Output: false Example 2: Input: arr = [3,5,5] Output: false Example 3: Input: arr = [0,3,2,1] Output: true [답]