전체 글 (164) 썸네일형 리스트형 383. Ransom Note https://leetcode.com/problems/ransom-note/description/?envType=study-plan-v2&envId=top-interview-150 Ransom Note - LeetCode Can you solve this real interview question? Ransom Note - Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise. Each letter in magazine can only be used once in ranso leetcode.com 1.아이.. 102. Binary Tree Level Order Traversal https://leetcode.com/problems/binary-tree-level-order-traversal/description/?envType=study-plan-v2&envId=top-interview-150 Binary Tree Level Order Traversal - LeetCode Can you solve this real interview question? Binary Tree Level Order Traversal - Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Example 1: [https:.. 169. Majority Element https://leetcode.com/problems/majority-element/description/?envType=study-plan-v2&envId=top-interview-150 Majority Element - LeetCode Can you solve this real interview question? Majority Element - Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists leetcode.com.. 88. Merge Sorted Array https://leetcode.com/problems/merge-sorted-array/description/?envType=study-plan-v2&envId=top-interview-150 Merge Sorted Array - LeetCode Can you solve this real interview question? Merge Sorted Array - You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1 an lee.. 637. Average of Levels in Binary Tree https://leetcode.com/problems/average-of-levels-in-binary-tree/description/?envType=study-plan-v2&envId=top-interview-150 Average of Levels in Binary Tree - LeetCode Can you solve this real interview question? Average of Levels in Binary Tree - Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10-5 of the actual answer wi.. 3-1 두 배열 합치기(자바) 첫 번째 배열의 크기 n이 주어집니다. n크기 만큼 배열에 입력받습니다. 두 번째 배열의 크기 m이 주어집니다. m크기 만큼 배열에 입력받습니다. 두 배열을 합쳐서 정렬한 후에 출력하면 됩니다. 문제풀이 : 배열1과 배열2를 arraylist에 넣은후에 컬렉션의 sort함수를 사용하여 정렬한 후에 출력하면 됩니다. import java.util.*; public class Main { static int[] arr1 = new int[100]; static int[] arr2 = new int[100]; static ArrayList arr3 = new ArrayList(); public static void main(String[] args){ Main main = new Main(); Scanner .. 프로그래머스(레벨2) JadenCase 문자열 만들기 JadenCase 문자열 만들기 문제를 풀어보았다. 벡터변수와 string 변수를 만들어서 공백으로 구분하여 벡터에 추가하였다. 현재 문자 위치가 공백이 아니고 현재 문자 -1에 해당하는 위치가 공백이라면 toupper메소드를 이용해서 대문자로 바꿔주면 해결할 수 있는 문제이다. #include #include #include #include using namespace std; string solution(string s) { string answer = ""; vector v; string temp = ""; for(int i = 0; i < s.length(); i++) { if(i == 0) { temp += toupper(s[i]); } else if(s[i] != ' ' && s[i-1] !=.. (프로그래머스 레벨1) 약수의 합 #include #include #include using namespace std; int solution(int n) { int answer = 0; int sum = 0; for(int i = 1; i 이전 1 2 3 4 5 6 7 ··· 21 다음