전체 글 - Table of Contents337 🥰 StrataScratch PythonPandas Easy I - 1 Solved 02119 Most Lucrative Products# Import your librariesimport pandas as pd# Start writing codeonline_orders.head()online_orders = online_orders[online_orders['date_sold'].between('2022-01-01','2022-06-30')]online_orders['total_revenue'] = online_orders['cost_in_dollars'] * online_orders['units_sold']online_orders.groupby('product_id')['total_revenue'].sum().reset_index(name='revenue').sort_values('.. Data Science Fundamentals/Pandas&Numpy and Questions 2025. 3. 16. 🥰 StrataScratch PythonPandas Medium I - 18 Solved 02099 Election Results# Import your librariesimport pandas as pd# Start writing codevoting_results.head() #voter / candidate#boolean indexing - filtering voters who didn't votevoting_results = voting_results[~voting_results['candidate'].isna()] #boolean indexing(condiiton included)#voting_results = voting_results.dropna()#voter ratevoting_results['voter_rate'] = voting_results['voter'].apply(lam.. Data Science Fundamentals/Pandas&Numpy and Questions 2025. 3. 9. ✈️ SQL Programmers Level 3 - 19 Solved 001. 대장균들의 자식의 수 구하기SELECT A.ID, COUNT(B.ID) AS CHILD_COUNTFROM ECOLI_DATA AS A LEFT JOIN ECOLI_DATA AS B ON A.ID = B.PARENT_IDGROUP BY A.IDORDER BY A.ID ASC ✨(1) 한 테이블 내부에 ID와 PARENT_ID 모두 동일한 경우는 두 동일 테이블을 JOIN 해야 한다.: 왼쪽 A, 오른쪽 B라 했을 때 왼쪽 ID를 parent, 오른쪽 ID를 child로 설정해서 A.ID = B.PARENT_ID로 JOIN(2) A의 정보 ID 기준 JOIN이므로 LEFT JOIN(3) 자식의 수를 출력해야 하므로 GROUP BY A.ID로 A 기준 그룹화 (4) 개체의 ID에 대해 오름차순 정렬이.. Database/SQL 2025. 3. 8. 📍API / RESTful API 📍 API?📍 'Application Programming Interface'로 SW들이 서로 대화할 때 사용되는 수단. 📍 ex) 시청하고 있는 youtube를 시청하기 위한 컴퓨터, 폰. 시청하는 youtube 영상들은 server라는 컴퓨터에 저장되어 있음. 각 기기들은 server로부터 영상들과 관련 데이터를 받아와 재생함. 즉 server에는 sw의 주문을 받아 서빙하는 sw가 실행되고 있다. 즉, 폰에서 youtube 앱을 켜면 youtube 앱은 server에 설치된 sw에게 '최신 컨텐츠'들의 목록을 보내달라는 요청을 함. 이에 대한 응답으로 server에서 보내줌. 그 외에도 다양한 작업들이 sw간의 대화로 이루어짐. 📍 API는 server 역할을 하는 프로그램이 나눠준 메뉴.. Computer Science/Basics and Concepts 2025. 3. 2. 🪗 OOP Fundamentals (1) ❤️ OOP 이전: 중심이 컴퓨터. 컴퓨터가 사고하는 대로 프로그래밍. ❤️ OOP: 인간 중심적 프로그래밍 패러다임. 현실 세계를 프로그래밍으로 옮겨와 프로그래밍. 객체 지향의 가장 기본은 객체이며, 객체의 핵심은 기능을 제공하는 것. 실제로 객체를 정의할 때 사용하는 것은 객체가 제공해야 할 기능(오퍼레이션(Operation))이며, 객체가 내부적으로 어떤 데이터를 갖고 있는 지로는 정의되지 않는다. 즉, 객체는 오퍼레이션으로 정의된다. (1) 추상화) 현실 세계의 사물들을 객체라고 보고, 그 객체로부터 개발하고자 하는 APP에 필요한 특징들을 뽑아와 프로그래밍 진행. (2) 이미 작성한 코드에 대한 재사용성이 높다. 자주 사용되는 로직을 라이브러리로 만들어 두면 계속해서 사용 가능, 신뢰성 확보 (.. OOP/Fundamentals 2025. 3. 2. 😍 LeetCode Easy Collections III - 6 Problems 0231. Power of Two / 0118. Pascal's Triangleclass Solution: def isPowerOfTwo(self, n: int) -> bool: if n 😍 0231) 큰 problem을 2로 계속 나누며 sub-problem으로 잘게 쪼개며 계속 문제를 풀어나가는 방식은 Recursion을 사용해야 함을 직관적으로 알 수 있다. 먼저 n == 1 / n%2 == 1 base case를 생각하고 / 그렇지 않다면 pot(n//2)로 잘게 쪼개어 문제를 풀어가면 OKclass Solution: def generate(self, numRows: int) -> List[List[int]]: ans = [[1]] .. LeetCode Problems/Easy 2025. 1. 29. 🥪Array 1. Fundamentals★ Stores items(C/C++) or their references(Python) at contiguous locations / a linear data structure that stores similar elements in contiguous memory locations. ★(1) Random Access: i-th item can be accessed in O(1) Time as we have the base address and every item or reference is of same size(2) Cache Friendliness: since items/references are stored at contiguous locations, we get th.. Computer Science/Data Structures 2025. 1. 17. ★Topology Sort Advanced - 2 Solved★ ★ 2252 줄 세우기 ★import sysinput=sys.stdin.readlinefrom collections import dequeN,M=map(int,input().split())indegree = [0] * (N+1)graph = [[] for _ in range(N+1)]for _ in range(M): A,B=map(int,input().split()) graph[A].append(B) indegree[B] += 1result = []queue = deque()#1for i in range(1,N+1): if indegree[i] == 0: queue.append(i)#2while queue: node = queue.popleft() result.. BOJ/🥇 2024. 12. 29. 🧑🏻💻 LeetCode Medium Collections 3 - 19 Problems 0003. Longest Substring Without Repeating Characters / 0221. Maximal Square#---------------- (1)class Solution: def lengthOfLongestSubstring(self, s: str) -> int: ans = 0 hashmap = dict() for i in range(len(s)): if s[i] in hashmap.keys(): needs_to_be_deleted_keys = set() for key in hashmap: if hashmap[key] int: .. LeetCode Problems/Medium 2024. 12. 9. (C++) ★Binary Search Intermediate I - 1 Solved★ ★ 1920 수 찾기 ★//1920#include #include #include #include #include #include #include #include #include #include using namespace std;int binary_search(vector &arr, int target){ int start, end; start = 0; end = arr.size()-1; int mid; while(start> N; vector arr1(N); for(int i=0;i> x; arr1[i]=x; } cin >> M; vector arr2(M); for(int i=0;i> y; arr2[i]=y; }.. C, C++/🥈 BOJ 2024. 11. 15. (C++) ★DP Upper-Intermediate I - 2 Solved★ ★ 2579 계단 오르기 ★//2579#include #include #include #include #include #include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, stair,tmp; cin >> N; tmp = N; vector dp(N+1, 0); vector stairs = {0}; while(tmp--){ cin >> stair; stairs.push_back(stair); } dp[1]=stai.. C, C++/🥈 BOJ 2024. 11. 15. (C++) ★Backtracking Intermediate I - 3 Solved★ ★ 15649 N과 M (1) ★//15649#include #include #include #include #include #include #include #include #include #include using namespace std;int N,M;vector ans;void track(){ if((int)ans.size()==M){ for(int i=0;i> N >> M; track(); return 0;}🙃 track() 백트래킹 재귀 함수 돌리기(1) 조건 충족 시, 충족된 vector 배열 내용 출력(2) 조건 미충족 시, 1부터 N까지의 자연수 일일이 돌리면서 ans 배열이 비었거나 해당 자연수가 ans 배열에 없거나 두 조건 중 한 개를 충족하면 push_bac.. C, C++/🥈 BOJ 2024. 11. 15. 이전 1 2 3 4 ··· 29 다음