일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- 데이터 베이스
- 오늘도 우라라 공략
- 리눅스
- MSG
- 반복문
- 오늘도 우라라
- ros
- ubuntu
- 오늘도 우라라 펫 공략
- JungOl
- topic
- publish
- install opencv-4.4.0 on ubuntu 22.04
- 토픽
- 등차수열
- 우분투
- 프로그래밍
- 마리아 DB
- 환경설정
- mysql
- mariaDB
- Linux
- C언어
- while
- C++
- LeetCode
- 그랑사가
- 오늘도 우라라 펫
- 기초
- Subscribe
- Today
- Total
목록Coding Test/LeetCode (9)
하루의 쉼터
Question : Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not. Example 1: Input : x = 121 Output : true Example 2: Input : x = -121 Output : false Explanation : From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome. Exa..
Question : Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. * Assume the environment does not allow you to store 64-bit integers (signed or unsigned). Example 1: Input: x = 123 Output: 321 Example 2: Example 2: Input: x = -123 Output: -321 Example 3: Example 3: Input: ..
Question : Reverse a singly linked list. Exapmle : Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? Solution.h #include #include #include struct ListNode { int val; ListNode* next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode* ne..
Question : Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Follow up: If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: [4,-1,2,1] has the largest sum = 6...
Question : Merge two sorted linked lists and return it as a new sorted list. The new list should be made by splicing together the nodes of the first two lists. Example 1 : Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] Example 2 : Input: l1 = [], l2 = [] Output: [] Example 3 : Input: l1 = [], l2 = [0] Output: [0] Constraints : The number of nodes in both lists is in the range [0, 50] -1..
Question Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. Follow up: Could you implement a solution with a linear runtime complexity and without using extra memory? Example 1: Input: nums = [2,2,1] Output: 1 Example 2: Input: nums = [4,1,2,1,2] Output: 4 Example 3: Input: nums = [1] Output: 1 Constraints: 1
Question : 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. Example 1:Input: s = "()"Output: true Example 2:Input: s = "()[]{}"Output: true Example 3:Input: s = "(]"Output: false Example ..
Question : Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Input: 38 Output: 2 Explanation: The process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it.Question Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would hav..