K

@kimjuha19

예산 배정 우선순위

Python
5 months ago
requests = [2, 2, 3, 3] budget = 10 count = 0 requests.sort() for i in range(len(requests)): if requests[i] > budget: break budget -= requests[i] count += 1

유료 콘텐츠 구독 시스템

Python
5 months ago
class Member: def __init__(self, name, id): self.name = name self.id = id def view_content(self): print("기본 콘텐츠를 감상합니다") class PremiumMember(Member):

센서 데이터 필터링

Python
5 months ago
class SensorData: def __init__(self, name): self.name = name self.readings = [] def add_reading(self, value): if -50 <= value <= 150: self.readings.append(value) def get_average(self):

신호등 제어 시스템

Python
5 months ago
class TrafficLight: def __init__(self): self.location = 0 self.color = ["Red", "Green", "Yellow"] def next_step(self): print(self.color[self.location]) self.location += 1 if self.location == len(self.

공유 킥보드 요금 계산기

Python
5 months ago
class Scooter: def __init__(self, ID, battery): self.ID = ID self.is_rented = False self.start_time = None self.battery = battery def rent(self, start_time): self.is_rented = True self.start_t

회원가입 비밀번호 검증 시스템

Python
5 months ago
class User: def __init__(self, id, password): self.id = id self.password = password def set_password(self,new_pw): if len(self.password) >= 8 and any(temp.isdigit()for temp in self.password) == True: new_

캐릭터 경험치 및 레벨업 시스템

Python
5 months ago
class Character: def __init__(self, nickname, level, exp): self.nickname = nickname self.level = level self.exp = exp def gain_exp(self, amount): self.exp += amount while self.exp >= 100:

계좌 이체 및 한도 관리

Python
5 months ago
class Account: def __init__(self, name, balance, limit): self.name = name self.balance = balance self.limit = limit def withdraw(self, amount): if amount > self.balance or amount > self.limit: pri

소수 찾기

Python
5 months ago
from itertools import permutations numbers = "17" nums = set() for i in range(1, len(numbers) + 1): for p in permutations(numbers, i): nums.add(int("".join(p))) count = 0

체육복 빌려주기

Python
5 months ago
n = 5 lost = [2, 4] reserve = [1, 3, 5] lost.sort() reserve.sort() new_lost = [] new_reserve = []

단어 변환 최소 횟수

Python
5 months ago
from collections import deque def solution(begin, target, words): if target not in words: return 0 visited = [False] * len(words) queue = deque([(begin, 0)]) def can_convert(a, b):

지그재그 숫자 배치

Python
5 months ago
N = 3 num = 1 for i in range(N): if i % 2 == 0: print(num, num+1, num+2) else: print(num+2, num+1, num) num += N

가장 긴 증가하는 부분 수열

Python
5 months ago
nums = [10, 20, 10, 30, 20, 50] nums.sort() answer = [] for n in nums: if n not in answer: answer.append(n) print(answer)

주식 가격

Python
5 months ago
prices = [1, 2, 3, 2, 3] n = len(prices) answer = [0] * n for i in range(n): time = 0 for j in range(i + 1, n): time += 1 if prices[j] < prices[i]: break

올바른 괄호

Python
5 months ago
s = "(())" stack = [] is_valid = True for ch in s: if ch == '(': stack.append(ch) else: if not stack: is_valid = False

가장 큰 수 만들기

Python
5 months ago
nums = [3, 30, 34, 5, 9] nums = list(map(str, nums)) nums.sort(key=lambda x: x*3, reverse=True) result = str(int("".join(nums))) print(result)

예산 배정

Python
5 months ago
requests = [1, 3, 2, 5, 4] budget = 9 count = 0 requests.sort() for i in range(len(requests)): budget -= requests[i] count += 1 if budget <= 0:

무인 카페 키오스크 시스템

C++
5 months ago
#include <iostream> using namespace std; class CoffeeMachine { private: string name; int bean; public: CoffeeMachine(string machineName, int beanAmount = 100) {

코리 코딩 성적 관리

Python
5 months ago
class StudentGrade: def __init__(self, name): self.name = name self.scores = {} def update_score(self, subject, score): self.scores[subject] = score def is_passed(self): average = sum(self.scores.values(

초 단위 시간 변환기

Python
5 months ago
class Timer: def __init__(self, seconds): self.seconds = seconds def get_time_format(self): total = self.seconds // 60 hour = total min = self.seconds - (60 * total) return hour,min