본문 바로가기

분류 전체보기1523

백준 25206 너의 평점은 https://www.acmicpc.net/problem/25206 25206번: 너의 평점은 인하대학교 컴퓨터공학과를 졸업하기 위해서는, 전공평점이 3.3 이상이거나 졸업고사를 통과해야 한다. 그런데 아뿔싸, 치훈이는 깜빡하고 졸업고사를 응시하지 않았다는 사실을 깨달았다! 치 www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 def sol(scores): grades = {'A+': 4.5, 'A0': 4.0, 'B+': 3.5, 'B0': 3.0, 'C+': 2.5, 'C0': 2.0, 'D+': 1.5, 'D0': 1.0, 'F': 0.0} total_gpa = total_class = 0 for score .. 2024. 2. 6.
leetcode 3028. Ant on the Boundary https://leetcode.com/problems/ant-on-the-boundary/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1 2 3 4 5 6 7 8 class Solution: def returnToBoundaryCount(self, nums: List[int]) -> int: location = answer = 0 f.. 2024. 2. 6.
leetcode 3019. Number of Changing Keys https://leetcode.com/problems/number-of-changing-keys/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1 2 3 4 5 6 7 8 9 class Solution: def countKeyChanges(self, s: str) -> int: answer = 0 for i in range(1, len.. 2024. 2. 5.
백준 9063 대지 https://www.acmicpc.net/problem/9063 9063번: 대지 첫째 줄에는 점의 개수 N (1 ≤ N ≤ 100,000) 이 주어진다. 이어지는 N 줄에는 각 점의 좌표가 두 개의 정수로 한 줄에 하나씩 주어진다. 각각의 좌표는 -10,000 이상 10,000 이하의 정수이다. www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 def sol(xs, ys): if len(list(set(xs))) == 1 or len(list(set(ys))) == 1: return 0 else: return (max(xs) - min(xs)) * (max(ys) - min(ys)) if __name__ == '__main__': n = int(inpu.. 2024. 1. 24.
leetcode 3014. Minimum Number of Pushes to Type Word I https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-i/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Solution: def minimumPushes(self, word: str) -> int: .. 2024. 1. 23.
leetcode 3010. Divide an Array Into Subarrays With Minimum Cost I https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1 2 3 4 5 6 7 8 9 from itertools import combinations class Solution: def minimumC.. 2024. 1. 23.
leetcode 645. Set Mismatch https://leetcode.com/problems/set-mismatch/description/?envType=daily-question&envId=2024-01-22 LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1 2 3 4 5 6 7 8 9 10 11 12 13 class Solution: def findErrorNums(self, nums: Lis.. 2024. 1. 22.
leetcode 1207. Unique Number of Occurrences https://leetcode.com/problems/unique-number-of-occurrences/description/?envType=daily-question&envId=2024-01-17 LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 123456789101112class Solution: def uniqueOccurrences(self, arr:.. 2024. 1. 17.
leetcode 2913. Subarrays Distinct Element Sum of Squares I https://leetcode.com/problems/subarrays-distinct-element-sum-of-squares-i/description/ Subarrays Distinct Element Sum of Squares I - LeetCode Can you solve this real interview question? Subarrays Distinct Element Sum of Squares I - You are given a 0-indexed integer array nums. The distinct count of a subarray of nums is defined as: * Let nums[i..j] be a subarray of nums consisting of all the ind.. 2024. 1. 15.
leetcode 3005. Count Elements With Maximum Frequency https://leetcode.com/problems/count-elements-with-maximum-frequency/description/ Count Elements With Maximum Frequency - LeetCode Can you solve this real interview question? Count Elements With Maximum Frequency - You are given an array nums consisting of positive integers. Return the total frequencies of elements in nums such that those elements all have the maximum frequency. The leetcode.com .. 2024. 1. 15.
leetcode 917. Reverse Only Letters https://leetcode.com/problems/reverse-only-letters/description/ Reverse Only Letters - LeetCode Can you solve this real interview question? Reverse Only Letters - Given a string s, reverse the string according to the following rules: * All the characters that are not English letters remain in the same position. * All the English letters (lowercase or leetcode.com 1 2 3 4 5 6 7 8 9 10 11 12 13 14.. 2024. 1. 13.
leetcode 1304. Find N Unique Integers Sum up to Zero https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/description/ Find N Unique Integers Sum up to Zero - LeetCode Can you solve this real interview question? Find N Unique Integers Sum up to Zero - Given an integer n, return any array containing n unique integers such that they add up to 0. Example 1: Input: n = 5 Output: [-7,-1,1,3,4] Explanation: These arrays als leetcode.com 1.. 2024. 1. 10.