본문 바로가기

부부의 코딩 성장 일기

검색하기
부부의 코딩 성장 일기
프로필사진 펩시_콜라

  • 분류 전체보기 (147)
    • Algorithm (135)
      • LeetCode (135)
    • Python (6)
      • Fundamentals (5)
      • Libraries (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/10   »
일 월 화 수 목 금 토
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 31
Tags
  • list
  • hash table
  • Binary
  • 리트코드
  • 문자열
  • 미디움
  • Python
  • Medium
  • string
  • binary tree
  • leetcode
  • easy
  • 중간
  • 쉬움
  • HashTable
  • sorting
  • DP
  • recursive
  • math
  • Array
  • 이진트리
  • matrix
  • 재귀
  • tree
  • Depth-first Search
  • two pointers
  • linked list
  • dfs
  • backtracking
  • binary search
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록투썸 (1)

부부의 코딩 성장 일기

LeetCode 1(Two Sum, Python)

1. 문제 링크 https://leetcode.com/problems/two-sum/ 2. 문제 설명 list와 target 숫자가 주어졌을 때, list의 두 수를 더했을 때 target 숫자가 되는, index list를 반환하는 문제 예시) nums = [2,7,11,15], target = 9 → output [0,1] 3. 처음 풀이 이중 for문을 돌려서, nums[i]와 nums[j]를 더한 게 target이면 index를 반환 class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: for i in range(len(nums)): for j in range(i+1,len(nums)): if nums[i]+num..

Algorithm/LeetCode 2023. 10. 28. 21:42
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바