목록언어/JAVA
Step-by-Step
https://leetcode.com/problems/restore-the-array/ Restore The Array - LeetCode Can you solve this real interview question? Restore The Array - A program was supposed to print an array of integers. The program forgot to print whitespaces and the array is printed as a string of digits s and all we know is that all integers in the array leetcode.com 숫자의 일부분을 그룹으로 나누는 경우의 수를 구하는 문제! 근데 조건이 있다. 1. 각 그..
https://www.acmicpc.net/problem/2637 2637번: 장난감 조립 첫째 줄에는 자연수 N(3 ≤ N ≤ 100)이 주어지는데, 1부터 N-1까지는 기본 부품이나 중간 부품의 번호를 나타내고, N은 완제품의 번호를 나타낸다. 그리고 그 다음 줄에는 자연수 M(3 ≤ M ≤ 100)이 주 www.acmicpc.net 거의 해본 경험이 없는 위상정렬, 열심히 공부하고 있다! 7번제품 만드는 데 4번제품 4개가 필요하고, 4번제품 만드는 데 1번제품 5개가 필요하다면? = 7번제품 만드는데 1번제품 4 * 5 = 20개가 필요하다. 위상정렬로 부모개수를 cnt 해서 올려주면 됨 [코드] import java.io.BufferedReader; import java.io.IOExceptio..

https://www.acmicpc.net/problem/21611 21611번: 마법사 상어와 블리자드 마법사 상어는 파이어볼, 토네이도, 파이어스톰, 물복사버그, 비바라기 마법을 할 수 있다. 오늘 새로 배운 마법은 블리자드이고, 크기가 N×N인 격자에서 연습하려고 한다. N은 항상 홀수이고, ( www.acmicpc.net 온풍기 풀고 이거 푸니까 살거같다.. ㅋㅋ ㅠ 우선 달팽이 규칙 솔직히 이건 까먹어도 바로 그 자리에서 찾아낼 수 있는 쉬운 규칙이다. 방법 d, s로 파괴할거 파괴 (이거는 ans에 담지 않는다) 달팽이 규칙으로 map의 숫자들 전부 Queue에 넣기 Queue 1개씩 뽑아서 연속된 숫자 개수 >= 4 인 경우 폭파시킴 폭파시킨 개수는 HashMap 에 넣고 최종 ans에 숫자..

https://www.acmicpc.net/problem/23289 23289번: 온풍기 안녕! 유난히 추운 날씨가 예상되는 이번 겨울을 대비하기 위해 구사과는 온풍기를 설치하려고 한다. 온풍기의 성능을 테스트하기 위해 구사과는 집을 크기가 R×C인 격자판으로 나타냈고, 1×1 크기 www.acmicpc.net 정말정말정말 생각해야하는 부분이 많다. 이 문제 ㅠㅠ.. 내 하루.. 과정 1. 집에 있는 모든 온풍기에서 바람이 한 번 나옴 - 온풍기 방향으로 온도 5 생성 - 5에서 온풍기랑 같은 방향으로 봤을때, 정면과 왼쪽대각선 및 오른쪽 대각선으로 온도 4 생성 - 위 과정을 1까지 반복 (단, 칸막이에 따라 온도가 높여지지 않을 수 있음) 2. 온도가 조절됨 - 두 칸의 온도 차이가 있을 경우 큰 쪽..
https://leetcode.com/problems/minimum-score-of-a-path-between-two-cities/ Minimum Score of a Path Between Two Cities - LeetCode Can you solve this real interview question? Minimum Score of a Path Between Two Cities - You are given a positive integer n representing n cities numbered from 1 to n. You are also given a 2D array roads where roads[i] = [ai, bi, distancei] indicates that leetcode.com 흔..
https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/description/ Construct Binary Tree from Inorder and Postorder Traversal - LeetCode Can you solve this real interview question? Construct Binary Tree from Inorder and Postorder Traversal - Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is t..
https://leetcode.com/problems/check-completeness-of-a-binary-tree/ Check Completeness of a Binary Tree - LeetCode Can you solve this real interview question? Check Completeness of a Binary Tree - Given the root of a binary tree, determine if it is a complete binary tree. In a complete binary tree [http://en.wikipedia.org/wiki/Binary_tree#Types_of_binary_trees], every leetcode.com ※ 경우에 따라 체크해야 할..
https://leetcode.com/problems/merge-k-sorted-lists/ Merge k Sorted Lists - LeetCode Can you solve this real interview question? Merge k Sorted Lists - You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it. Example 1: Input: lis leetcode.com LinkedList 값 받아오면서 null값만 적절히 체크해주면 금방 풀리는 문제 L..