일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 릿코드풀기
- 파이썬릿코드
- 릿코드
- leetcode 풀기
- python sorted
- 잇츠디모
- 파이썬 알고리즘 풀기
- 릿코드풀이
- 파이썬알고리즘풀기
- python Leetcode
- python priority queue
- 릿코드 파이썬
- 상가수익률계산기
- binary search
- 파이썬 프로그래머스
- python 릿코드
- 파이썬 알고리즘
- 파이썬알고리즘
- leetcode풀이
- python xor
- python zip_longest
- 파이썬 릿코드
- python 알고리즘
- 파이썬릿코드풀기
- 코틀린기초
- LeetCode
- leetcode풀기
- 릿코드 풀기
- 알고리즘풀이
- 알고리즘풀기
- Today
- Total
목록분류 전체보기 (273)
소프트웨어에 대한 모든 것

문제) 1365. How Many Numbers Are Smaller Than the Current Number Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i]. Return the answer in an array. Example 1: Input: nums = [8,1,2,2,3] Output: [4,0,1,1,3] Explanation: For nums[0]=8 there exist f..

문제) 2389. Longest Subsequence With Limited Sum You are given an integer array nums of length n, and an integer array queries of length m. Return an array answer of length m where answer[i] is the maximum size of a subsequence that you can take from nums such that the sum of its elements is less than or equal to queries[i]. A subsequence is an array that can be derived from another array by delet..

문제) 2418. Sort the People You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n. For each index i, names[i] and heights[i] denote the name and height of the ith person. Return names sorted in descending order by the people's heights. Example 1: Input: names = ["Mary","John","Emma"], heights = [180,165,170] Output: [..

문제) 1318. Minimum Flips to Make a OR b Equal to c Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c ). (bitwise OR operation). Flip operation consists of change any single bit 1 to 0 or change the bit 0 to 1 in their binary representation. Example 1: Input: a = 2, b = 6, c = 5 Output: 3 Explanation: After flips a = 1 , b = 4 , c..

제목 문제) 2367. Number of Arithmetic Triplets You are given a 0-indexed, strictly increasing integer array nums and a positive integer diff. A triplet (i, j, k) is an arithmetic triplet if the following conditions are met: i < j < k, nums[j] - nums[i] == diff, and nums[k] - nums[j] == diff. Return the number of unique arithmetic triplets. Example 1: Input: nums = [0,1,4,6,7,10], diff = 3 Output: 2 ..

문제) 2352. Equal Row and Column Pairs Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair is considered equal if they contain the same elements in the same order (i.e., an equal array). Example 1: Input: grid = [[3,2,1],[1,7,6],[2,7,7]] Output: 1 Explanation: There is 1 equal row and column pair: - (Row 2..

문제) 2373. Largest Local Values in a Matrix You are given an n x n integer matrix grid. Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that: maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1. In other words, we want to find the largest value in every contiguous 3 x 3 matrix in grid. Return the generated matrix. ..
리스트에서 요소가 있는지 종종 확인하는(멤버십) 코드를 작성합니다. nums = [1, 3, 5, 7, 9] if 3 in nums: print('3 is in nums') 집합(set) 또한 멤버십 코드를 작성할 수 있습니다. 리스트와 동일하게 in 코드를 사용합니다. 그런데 궁금합니다. 누가 더 빠를까요???? 리스트는 배열처럼 사용하기 때문에 직관적으로 집합보다 더 느릴 것 같네요. 결론적으로, 멤버십의 시간 복잡도는 리스트는 평균적으로 O(n), 집합은 O(1)의 시간 복잡도를 갖습니다. 집합 자료구조는 해싱 구조를 갖습니다. 이것이 리스트와 다르게 속도 차이를 가져 옵니다. Set in Python can be defined as the collection of items. In Python, ..