Leetcode#3_Longest Substring Without Repeating Characters _05wk01 by SOMJANG 포스팅 썸네일 이미지

우리가 공부한 것 들/알고리즘

Leetcode#3_Longest Substring Without Repeating Characters _05wk01 by SOMJANG

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 must be a su..

2020.05.11 게시됨

Leetcode#1_02w03 Code Review 결과 정리 포스팅 썸네일 이미지

우리가 공부한 것 들/알고리즘

Leetcode#1_02w03 Code Review 결과 정리

1. Reverse Integer - 제곱을 만드는 함수 : pow 사용 예시 ) 2^31 => pow(2, 31) / -2^31 => pow(-2, 31) 추측 : pow가 ** 방식으로 제곱을 만드는 것 보다 빠를것 같다 테스트! import time pow_times = [] two_star_times = [] for i in range(10): startTime = time.time() nZegob = pow(i, 31) endTime = time.time() - startTime pow_times.append(endTime) for i in range(10): startTime2 = time.time() nZegob2 = i ** 31 endTime2 = time.time() - startTim..

2020.02.22 게시됨

Leetcode#1_Add Two Numbers_02w03 by SOMJANG 포스팅 썸네일 이미지

우리가 공부한 것 들/알고리즘

Leetcode#1_Add Two Numbers_02w03 by SOMJANG

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: 342 + 46..

2020.02.20 게시됨