일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- LeetCode
- 리액트
- 코테연습
- CS
- 자바스크립트
- dp
- python
- 카카오
- Medium
- 배열
- 프로그래밍
- sql
- 고득점Kit
- OS
- web
- 동적계획법
- C++
- Doitvue.js입문
- Level1
- Level3
- Level2
- 리트코드
- 프로그래머스
- typescript
- 백준
- 웹프로그래밍
- VUE
- react
- 파이썬
- javascript
- Today
- Total
목록리트코드 (22)
415. Add Strings Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string. You must solve the problem without using any built-in library for handling large integers (such as BigInteger). You must also not convert the inputs to integers directly. class Solution: def addStrings(self, num1: str, num2: str) -> str: carry = 0 res = [] p1 = len(..
1578. Minimum Time to Make Rope Colorful 문제 설명 Alice wants the rope to be colorful. She does not want two consecutive balloons to be of the same color, so she asks Bob for help. Bob can remove some balloons from the rope to make it colorful. You are given a 0-indexed integer array neededTime where neededTime[i] is the time (in seconds) that Bob needs to remove the ith balloon from the rope. Retu..
1710. Maximum Units on a Truck 문제 설명 You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]: numberOfBoxesi is the number of boxes of type i. numberOfUnitsPerBoxi is the number of units in each box of the type i. You are also given an integer truckSize, which is the maximum number of boxes that ca..
76. Minimum Window Substring Problem Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring**, return the empty string "". t를 만족하는 s의 최소 부분 문자열 찾기 Constraints: m == s.length n == t.length 1 0 : target_len -= 1 target_cnt[s[end]] -= 1 while ta..
209. Minimum Size Subarray Sum 문제 Given an array of positive integers nums and a positive integer target, return the minimal length of a contiguous subarray [numsl, numsl+1, ..., numsr-1, numsr] of which the sum is greater than or equal to target. If there is no such subarray, return 0 instead. 제한사항 1
724. Find Pivot Index 오른쪽 숫자들의 합과 왼쪽 숫자들의 합이 같아지는 피벗의 위치 찾기 [1, 8, 2, 9, 2, 3, 6] : 9 [2, 5, 7] : -1 (가능한 피벗이 없음) Brute-force? o(n) * n -> o (n ^ 2) 비효율적임 sliding 전체 합계를 구해준다. 피벗을 0부터 한 칸씩 움직이면서 right sum에는 빼고 left sum에는 이전 피벗 값을 더해준다. right sum과 left sum이 같아지는 지점을 찾는다. [1, 8, 2, 9, 2, 3, 6] 0 | sum() - 1 1 + 0 | sum() - 1 - 8 8 + 1 + 0 | sum() - 1 - 8 - 2 . . . 전체 합계를 구하는데 O(n) 매번 오퍼레이션이 O(1)..