본문 바로가기
728x90

Language190

[Programmers | Java | 코딩테스트 입문 문제 풀이] 두 수의 합 - Solution with Arithmetic Operator KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA➕ 두 수의 합🏷 Topic : 연산자 산술 연산자 덧셈 연산자 문제 설명정수 num1과 num2가 주어질 때, num1과 num2의 합을 return하도록 soltuion 함수를 완성해주세요. 제한사항-50,000 ≤ num1 ≤ 50,000-50,000 ≤ num2 ≤ 50,000입출력 예num1num2result2351002102입출력 예 설명입출력 예 #1 num1이 2이고 num2가 3이므로 2 + 3 = 5를 return합니다.입출력 예 #2 num1이 100이고 num2가 2이므로 100 + 2 = 102를 return합니다.✔ Solution with Arithmetic Operatorclas.. 2024. 6. 1.
[DB 봐 | ORACLE SQL] GROUP BY, HAVING 절 사용법 GROUP BY 절그룹별 건수나 합계를 얻을 수 있다.HAVING 절그룹별 집계 결과 중 원하는 결과만 필터링하기 위해 필터 조건을 줄 수 있다.HAVING 절 vs WHERE 절HAVING 절GROUP BY 절과 함께 사용해야 함.SELECT ANIMAL_TYPE, COUNT(*) CNT FROM ANIMAL_INS GROUP BY ANIMAL_TYPE; 실행 결과 SELECT ANIMAL_TYPE, COUNT(*) CNT FROM ANIMAL_INS GROUP BY ANIMAL_TYPE HAVING COUNT(*) > 50; 실행 결과 GROUP BY 컬럼만 조건절에 사용할 수 있다.(GROUP BY에 사용되지 않은 컬럼을 조건으로 사용하면 오류 발생!)SELECT A.. 2024. 6. 1.
[Programmers | SQL | SUM, MAX, MIN 문제 풀이] 동물 수 구하기 - Solution with COUNT KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | SQL CODEKATA🐕 동물 수 구하기🏷 Topic : SUM MAX MIN COUNT문제 설명ANIMAL_INS 테이블은 동물 보호소에 들어온 동물의 정보를 담은 테이블입니다.ANIMAL_INS 테이블 구조는 다음과 같으며, ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, SEX_UPON_INTAKE는 각각 동물의 아이디, 생물 종, 보호 시작일, 보호 시작 시 상태, 이름, 성별 및 중성화 여부를 나타냅니다.NAMETYPENULLABLEANIMAL_IDVARCHAR(N)FALSEANIMAL_TYPEVARCHAR(N)FALSEDATETIMEDATETIMEFALSEINTAKE_CONDITI.. 2024. 6. 1.
[LeetCode | Java | Tree 문제 풀이] 2331. Evaluate Boolean Binary Tree - Solution with DFS 99클럽 | 비기너🌲 2331. Evaluate Boolean Binary Tree🏷 Topic : Tree Binary Tree DFS; Depth-First SearchEasyYou are given the root of a full binary tree with the following properties:Leaf nodes have either the value 0 or 1, where 0 represents False and 1 represents True.Non-leaf nodes have either the value 2 or 3, where 2 represents the boolean OR and 3 represents the boolean AND.The evaluation of a n.. 2024. 6. 1.
[LeetCode | Java | Tree 문제 풀이] 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree 99클럽 | Begginer🐾 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree🏷 Topic : Tree Binary Tree BFS DFSEasyGiven two binary trees original and cloned and given a reference to a node target in the original tree.The cloned tree is a copy of the original tree.Return a reference to the same node in the cloned tree.Note that you are not allowed to change any of the two trees or .. 2024. 5. 31.
[Programmers | Java | 코딩테스트 입문 문제 풀이] 숫자 비교하기 - Solution with Ternary Operator KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | Algorithm CODEKATA숫자 비교하기🏷 Topic : 조건문 삼항 연산자 비교 연산자 문제 설명정수 num1과 num2가 매개변수로 주어집니다. 두 수가 같으면 1 다르면 -1을 retrun하도록 solution 함수를 완성해주세요.제한사항0 ≤ num1 ≤ 10,0000 ≤ num2 ≤ 10,000입출력 예num1num2result23-111111799-1입출력 예 설명입출력 예 설명 #1 num1이 2이고 num2가 3이므로 다릅니다. 따라서 -1을 return합니다.입출력 예 설명 #2 num1이 11이고 num2가 11이므로 같습니다. 따라서 1을 return합니다.입출력 예 설명 #3num1이 7이고 num2가 99이므로.. 2024. 5. 31.
[Java 봐 | 자료 구조] 트리(Tree) 개념 정리 1. 트리(Tree)비선형 구조 중 하나데이터를 계층적으로 구조화 하여 저장하는 자료 구조노드(Node)들과 노드들을 연결하는 링크(Link)들로 구성됨.root, branch, leaf가 연결되어 있다.central node, structural node, sub-node가 edge를 통해 연결되어 있다.노드(node)들 간에 계층적인 관계를 가지고 있다.재귀 구조(Recursive Structure)를 형성 각 노드는 여러 개의 자식 노드(child node)를 가질 수 있다.그리고 이러한 자식 노드(child node) 또한 자식 노드(child node)를 가질 수 있다.루트 노드(root node)와 0개 이상의 하위 트리(sub-tree)로 구성된다. 용어> 편의상 노드의 높이(height.. 2024. 5. 30.
[LeetCode | Java | DFS/BFS 문제 풀이] 938. Range Sum of BST - Solution with Recursion Function 99클럽 | Begginer938. Range Sum of BST 🏷 Topic : Tree Depth-First Search Binary Search Tree Binary Tree BFS DFSEasyGiven the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high].Example 1:Input: root = [10,5,15,3,7,null,18], low = 7, high = 15Output: 32Explanation: Nodes 7, 10, and 15 are in the rang.. 2024. 5. 30.
[Programmers | SQL | SELECT 문제 풀이] 동물의 아이디와 이름 - Solution with SELECT & ORDER BY KDT 실무형 스프링 백엔드 엔지니어 양성과정 6기 | SQL CODEKATA🐶 동물의 아이디와 이름🏷 Topic : SELECT ORDER BY문제 설명ANIMAL_INS 테이블은 동물 보호소에 들어온 동물의 정보를 담은 테이블입니다.ANIMAL_INS 테이블 구조는 다음과 같으며,ANIMAL_ID, ANIMAL_TYPE, DATETIME, INTAKE_CONDITION, NAME, SEX_UPON_INTAKE는 각각 동물의 아이디, 생물 종, 보호 시작일, 보호 시작 시 상태, 이름, 성별 및 중성화 여부를 나타냅니다. NAMETYPENULLABLEANIMAL_IDVARCHAR(N)FALSEANIMAL_TYPEVARCHAR(N)FALSEDATETIMEDATETIMEFALSEINTAKE_CONDIT.. 2024. 5. 30.
728x90


Top