전체 글336

🥰 StrataScratch PythonPandas Medium I - 3 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.
(C++) ★Set/Map Upper-Intermediate I - 1 Solved★ ★ 20920 영단어 암기는 괴로워 ★//20920#include #include #include #include #include #include #include #include #include #include using namespace std;int N,M;string word;map freq;vector vocas;bool compare(string a, string b){ if(freq[a] != freq[b]){ return freq[a] > freq[b]; } else{ if(a.size() != b.size()){ return a.size() > b.size(); } else{ retur.. C, C++/🥈 BOJ 2024. 11. 15.
(C++) ★Stack & Queue & Deque Intermediate I - 4 Solved★ ★ 28278 스택 2 ★//28278#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, order, num; cin >> N; stack s; while(N--){ cin>>order; if (order==1){ cin>>num; s.push(num); } else if(orde.. C, C++/🥈 BOJ 2024. 11. 15.
(C++) ★Number Theory Intermediate I - 2 Solved★ ★ 1929 소수 구하기 ★//1929#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 M, N; cin >> M >> N; vector sieve(N+1, true); for(int i=2;i👳🏻‍♀️ vector sieve 가변 배열을 만든다. (N+1, true)를 뒤에 붙이면 총 N+1개의 자리가 있고 모두 true로 initialization. 👳🏻‍♀️자연수 N까지의 모든 소수 구하기 (에라토.. C, C++/🥈 BOJ 2024. 11. 15.
(C++) ★Set/Map Intermediate I - 5 Solved★ ★ 10815 숫자 카드 ★//10815#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,M,card,judge; vector cards; vector judges; map Map; cin >> N; while(N--){ cin >> card; Map.insert({card, true}); } cin >> M; while(M--){ cin >> judge; .. C, C++/🥈 BOJ 2024. 11. 14.
(C++) ★Sorting Intermediate I - 5 Solved★ ★ 1427 소트인사이드 ★//1427#include #include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string N; cin >> N; sort(N.begin(), N.end(), greater()); cout  🚀 내림차순은 sort()의 세번째 인자에 greater를 넣는다. 이 때, 문자열의 각 문자를 내림차순으로 정렬한다면 greater. 만약에 int형 변수가 들어간 array를 내림차순 정렬한다면 greater를 sort()의 세번째 인자로 넣는다... C, C++/🥈 BOJ 2024. 11. 14.
(C++)★Sorting Upper-Beginner I - 1 Solved★ ★ 2750 수 정렬하기 ★//1436#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; cin >> N; vector arr{}; while(N--){ int x; cin >> x; arr.push_back(x); } sort(arr.begin(),arr.end()); for(int x=0;x 👯‍♂️ vector arr{}로 가변 배열 만들고 push_back()으로 업데이트. 이.. C, C++/🥉 BOJ 2024. 11. 14.
(C++)★BF Intermediate I - 1 Solved★ ★ 1436 영화감독 숌 ★//1436#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, n = 666, cnt = 1; string n_string; bool found = false; cin >> N; while(true){ n_string = to_string(n); found = false; for(int x = 0; x  🧕🏼 주어진 숫자를 문자열 string으로 바꾸는 to_stri.. C, C++/🥈 BOJ 2024. 11. 14.
(C++)★Math & Geometry Upper-Beginner I - 1 Solved★ ★ 14215 세 막대 ★//14215#include #include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int arr[3]; cin >> arr[0] >> arr[1] >> arr[2]; sort(arr, arr+3); if((arr[0]+arr[1]) 🤙 sort(arr, arr+3)로 주어진 배열의 길이를 sorting할 수 있다. 🤙 cin >> arr[0] >> arr[1] >> arr[2]로 직접 입력한 숫자 자체를 바로 배열에 넣을 수 있다. .. C, C++/🥉 BOJ 2024. 11. 14.
(C++) ★Number Theory Upper-Beginner I - 3 Solved★ ★ 9506 약수들의 합 ★//9506#include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,total; while(1){ cin >> n; if(n==-1){ break; } total = 1; vector numbers = {}; for(int x=2;x 🧚‍♂️ 가변 배열 vector numbers = {} 만들어 놓고, 약수일 때 numbers.push_back(x); 사용.. C, C++/🥉 BOJ 2024. 11. 14.
(C++) ★Implementation&Simulation Intermediate I - 2 Solved★ ★ 2941 크로아티아 알파벳 ★//2941#include #include #include #include using namespace std;int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string S; int x; cin >> S; vector arr = {"c=","c-","dz=","d-","lj","nj","s=","z="}; for(int i =0 ; i  🤝 vector으로 문자열이 들어간 배열을 생성(#include ) 🤝 find() 함수 안에 크로아티아 변경된 알파벳 문자열을 넣으면, 해당 문자열이 들어가는 위치를 index로 알 수 있다... C, C++/🥈 BOJ 2024. 11. 14.
(C++) ★Implementation Upper-Beginner I - 8 Solved★ ★ 10811 바구니 뒤집기 ★#include #include using namespace std;void swap(int *a, int *b){ int tmp = *a; *a = *b; *b = tmp;}int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, M; cin >> N >> M; int* basket = new int[N]; for(int x = 0; x > i >> j; for(int a = 0; a  🤝 바구니 i부터 바구니 j까지 역순으로 넣는 방법은, iterator x가 바구니 i부터 (i+j)/2까지 돌며 양 옆(x와 을.. C, C++/🥉 BOJ 2024. 11. 13.
(C++) ★Implementation Beginner I - 28 Solved★ ★ 1330 두 수 비교하기 ★//1330#include #include using namespace std;int main(int argc, char const *argv[]) { int A, B; cin >> A >> B; if (A > B){ cout ' ★ 9498 시험 성적 ★#include #include using namespace std; int main(int argc, char const *argv[]){ int score; cin >> score; if(score >= 90){ cout = 80){ cout = 70){ cout = 60){ cout ★ 2753 윤년 ★#include #.. C, C++/🥉 BOJ 2024. 11. 13.
(C++) ★Basics I - 16 Solved★ ★ 2557 Hello World ★#include using namespace std;int main(){ cout ★ 1000 A + B ★ / ★ 1001 A - B ★ / ★ 10998 A x B ★#include using namespace std;int main(){ int A, B; cin >> A; cin >> B; cout ★ 1008 A / B ★#include using namespace std;int main(){ double A, B; cin >> A >> B; cout.precision(12); cout  🤝 cout.precision(12)으로 실수 전체를 12자리로 표현하겠다는 뜻.🤝 fixed 써서 12자리로 고정한 숫자로.. C, C++/🥉 BOJ 2024. 11. 13.
💐Operating Systems Fundamentals 2 - Process 1/2 Process & Thread 🚀 Process: 컴퓨터에서 실행중인 하나의 프로그램. 프로그램은 특정 작업을 수행하기 위한 명령어의 집합. 각 프로세스마다 RAM의 독립된 메모리 영역(코드, 데이터, 힙, 스택)을 할당 받는다. 따라서 다른 프로세스의 메모리 영역에 존재할 수 없다(위 프로세스 A 연두색 메모리와 프로세스 B 노란색 메모리가 별도로 존재한다) 🚀 그리고 각 프로세스마다 PCB(프로세스 제어 블록)이 만들어진다. PCB는 RAM 내에서 커널 메모리 영역에 별도 관리되며, kernel mode에서만 접근 가능하다(앞의 포스팅에서 kernel mode와 user mode에 대해서 배웠다. user mode일 때는 프로세스 메모리까지 접근 가능하지만, 실제 중요한 PCB는 접근이 불가능하다.. Computer Science/Basics and Concepts 2024. 11. 1.
🧑🏻‍💻 LeetCode Medium Collections 2 - 20 Problems 0054. Spiral Matrix / 0739. Daily Temperaturesclass Solution: def spiralOrder(self, matrix: List[List[int]]) -> List[int]: e,s,w,n = [0,1], [1,0], [0,-1], [-1,0] output = [] rows, cols = len(matrix), len(matrix[0]) visited = [[False] * cols for _ in range(rows)] cnt = 0 x, y = 0,0 dirs = [e,s,w,n] dir_i = 0 while True: .. LeetCode Problems/Medium 2024. 10. 31.
💐 Operating Systems Fundamentals 1 intro🚀 운영체제(OS)란, 하드웨어 위에 설치되어 하드웨어(HW) 계층과 다른 소프트웨어(SW) 계층을 연결하는 SW 계층. 🚀① 컴퓨터 시스템의 자원 관리② 사용자가 컴퓨터를 사용할 수 있는 환경 제공: CPU, 메모리 같은 컴퓨터 자원은 제한적이므로 자원 관리는 매우 중요! 이를 OS가 담당③ 사용자 컴퓨터 간 인터페이스 제공 → 사용자가 컴퓨터를 편리하게 사용할 수 있는 환경 제공ex) 대표적인 OS: Windows, macOS, Linux, Unix 🚀 4가지 목적① 처리능력(throughput) 향상: 자원 관리를 통해 일정 시간 내에 시스템 처리량 향상② 반환시간(turnaround time) 단축: 사용자가 시스템에 요청한 작업 완료 시간 단축③ 사용 가능도(availability.. Computer Science/Basics and Concepts 2024. 10. 30.