본문 바로가기

algorithm63

[LeetCode] ReverseInteger 문제 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 Note: Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For the purpose of this problem, assume that your function returns 0 when the reversed integer.. 2020. 7. 11.
[LeetCode] LongestSubstring 문제 Given a string, find the length of the longest substring without repeating characters. Example 1:* Input:* "abcabcbb" Output:* 3 Explanation:* The answer is "abc", with the length of 3. Example 2: Input:* "bbbbb" Output:* 1 Explanation: The answer is "b", with the length of 1. Example 3: Input:* "pwwkew" Output:* 3 Explanation: The answer is "wke", with the length of 3. Note that the answer m.. 2020. 7. 11.
[LeetCode] LongestPalindromicSubstring 문제 https://leetcode.com/problems/longest-palindromic-substring/ 문제풀이 양옆을 비교해 나감. c[i] == c[j] && i-j 2020. 7. 11.
[LeetCode] AddTwoNumbers 문제 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 contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Example: Input:* (2 -> 4 -> 3) + (5 -> 6 -> 4) Output:* 7 -> 0 -> 8 Explanation:* 3.. 2020. 7. 11.