목록언어
Step-by-Step
https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ Binary Tree Zigzag Level Order Traversal - LeetCode Binary Tree Zigzag Level Order Traversal - Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the next level and alternate between). Example 1: [https://assets leetcode.com DFS를 이용..
https://leetcode.com/problems/invert-binary-tree/ Invert Binary Tree - LeetCode Invert Binary Tree - Given the root of a binary tree, invert the tree, and return its root. Example 1: [https://assets.leetcode.com/uploads/2021/03/14/invert1-tree.jpg] Input: root = [4,2,7,1,3,6,9] Output: [4,7,2,9,6,3,1] Example 2: [https://assets.lee leetcode.com Easy.. 그만!! Medium 나왔으면 좋겠다😂 트리의 모든 레벨에서 좌우를 반전시켜주면..
https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/ Longest Substring with At Least K Repeating Characters - LeetCode Longest Substring with At Least K Repeating Characters - Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k. Example 1: Inpu..
https://leetcode.com/problems/minimum-distance-between-bst-nodes/ Minimum Distance Between BST Nodes - LeetCode Minimum Distance Between BST Nodes - Given the root of a Binary Search Tree (BST), return the minimum difference between the values of any two different nodes in the tree. Example 1: [https://assets.leetcode.com/uploads/2021/02/05/bst1.jpg] Input: root leetcode.com Tree를 DFS로 돌면서 val 값..
https://leetcode.com/problems/add-binary/ Add Binary - LeetCode Can you solve this real interview question? Add Binary - Given two binary strings a and b, return their sum as a binary string. Example 1: Input: a = "11", b = "1" Output: "100" Example 2: Input: a = "1010", b = "1011" Output: "10101" Constraints: * leetcode.com 2진수 ↔ 10진수 (Binary to Decimal / Decimal to Binary) 방법은 쓰지말자 범위를 보면 오버플로..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dn9tvc/btrYDfzgAa1/c2d9j5QiAPEvLjCRHxK8v1/img.png)
https://leetcode.com/problems/naming-a-company/description/ Naming a Company - LeetCode Naming a Company - You are given an array of strings ideas that represents a list of names to be used in the process of naming a company. The process of naming a company is as follows: 1. Choose 2 distinct names from ideas, call them ideaA and ideaB. 2. Sw leetcode.com 이게 왜 Hard인지 첫 제출하고 느낀 문제 총 3가지로 시도했는데, 1..
https://leetcode.com/problems/fruit-into-baskets/ Fruit Into Baskets - LeetCode Fruit Into Baskets - You are visiting a farm that has a single row of fruit trees arranged from left to right. The trees are represented by an integer array fruits where fruits[i] is the type of fruit the ith tree produces. You want to collect as much frui leetcode.com 백준은 유형별로 풀 수 있는 장점이 있지만, 하다 보면 점점 풀고 싶은 것만 풀고, 쉽..
https://www.acmicpc.net/problem/14908 14908번: 구두 수선공 최소 보상금을 지불하는 작업 순서를 출력해야 한다. 모든 작업은 입력에서의 번호(1~N)로 표시해야 한다. 모든 정수는 한 줄로 표시해야 하며, 각 작업은 공백 문자로 구분한다. 여러 가지 해답 www.acmicpc.net 정렬 조건 1. 일의 능률이 높은 순 (T/S) 2. i가 빠른 순 compare의 리턴값은 int 이기 때문에 if로 비교해서 1 or -1을 리턴하도록 하였다 PQ로 로직을 만들어 데이터를 넣고, 차근차근 빼서 출력해주면 됨 [코드] package BOJ; import java.io.BufferedReader; import java.io.IOException; import java.io...