Light Blue Pointer
본문 바로가기

분류 전체보기304

5. Longest Palindromic Substring 문제 주소 https://leetcode.com/problems/longest-palindromic-substring/ len(longest)): longest = temp return longest; Input s = "babad" Output "bab" Expected "bab" Input s = "cbbd" Output "" Expected "bb" j-i면 i,j가 1차이날때 2개 비교하게 계획했는데 1개밖에 안 돌아가는 거 같아서 for k in range(j-i+1): 여기 고쳤더니 되긴 되는데 시간초과됨 temp 넣고 읽는걸 줄여봄 class Solution: def longestPalindrome(self, s: str) -> str: longest = ""; for i in range(l.. 2023. 7. 20.
4. Median of Two Sorted Arrays 문제 주소 https://leetcode.com/problems/median-of-two-sorted-arrays/ Median of Two Sorted Arrays - LeetCode Can you solve this real interview question? Median of Two Sorted Arrays - Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1 leetcode.com 문제 Given two sorted arrays .. 2023. 7. 20.
3.Longest Substring Without Repeating Characters 문제 주소 https://leetcode.com/problems/longest-substring-without-repeating-characters/ int: input = list(map(int, str(num))) temp = [] longest = 0 i=0 j=1 longest = thislist[i:j] while(jlongest): longest = temp break; i++; return longest; 처음에는 i를 고정시키고 j만 움직이려고 했는데 곧 그게 잘못되었단걸 알게되었다 왜냐하면 모든 원소가 새 원소 후보랑 같은지 비교해야 했기 때문이다 그래서 while루프 대신에 for 루프를 쓰기로 했다 To insert at the end, do this temp.insert(len(te.. 2023. 7. 20.
2. Add Two Numbers 이때 푼 풀이에서는 숫자를 다루다보니 소숫점이 많아지면 값이 미묘하게 달라져서 스트링으로 취급해봄 : https://greedydeveloper.tistory.com/64 Given Problem 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 contains a single digit. Add the .two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading ze.. 2023. 7. 20.
1.1 Two Sum 파생문제(자작) 문제 똑바로 안 읽고 첫줄을 알아서 스킵해버림 그 결과 엄청나게 어려운 문제로 바뀌었다 이거 푼다고 3시간이나 붙어있었는데 ㅋㅋㅋㅋ 그럴 문제가 아니었음을... input List에 들어있는 숫자의 조합으로 결과값을 만든다 List[int]: col = 1; row = len(nums); for i in range(len(nums)): col = col*2 array = [[0 for c in range(col)] for r in range(row)] end = col; for i in range(row): end = end/2; count = False; for j in range(col): if(j%end == 0): count = not count; if(count == True): array[i].. 2023. 1. 2.
1.Two Sum 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 have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1:Input: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: Because nums[0] + nums[1] == 9, we return [0, 1]. Exa.. 2023. 1. 2.
파이썬 기본 출력 기본출력 print()함수 print("Hello, World!") 2022. 8. 5.
파이썬 기초 문법 더보기 기본출력 print("Hello, World!") 2022. 8. 5.
006 요구사항 정의 1 요구사항 요구사항은 소프트웨어가 어떤 문제를 해결하기 위해 제공하는 서비스에 대한 설명과 정 상적으로 운영되는데 필요한 제약조건이다 소프트웨어 개발이나 유지 보수 과정에서 필요한 기준과 근거를 제공한다 개발에 참여하는 이해관계자들 간의 의사소통을 원활하게 하는데 도움을 준다 요구사항의 유형 - 기능 요구사항 (Functional requirements) - 비기능 요구사항(Non-functional requirements) - 사용자 요구사항(User requirements) - 시스템 요구사항(System requirements) 2 기능 요구사항( Functional requirements) 기능 요구사항은 시스템이 무엇을 하는지, 어떤 기능을 하는지 등의 기능이나 수행과 관련된 요구사항이다. 시.. 2022. 4. 4.