목록알고리즘 (98)
forest_moon
문제 설명 머쓱이는 할머니께 생신 축하 편지를 쓰려고 합니다. 할머니가 보시기 편하도록 글자 한 자 한 자를 가로 2cm 크기로 적으려고 하며, 편지를 가로로만 적을 때, 축하 문구 message를 적기 위해 필요한 편지지의 최소 가로길이를 return 하도록 solution 함수를 완성해주세요. 제한사항 공백도 하나의 문자로 취급합니다. 1 ≤ message의 길이 ≤ 50 편지지의 여백은 생각하지 않습니다. message는 영문 알파벳 대소문자, ‘!’, ‘~’ 또는 공백으로만 이루어져 있습니다. 입출력 예 설명 입출력 예 #1 message의 글자 수가 15개로 최소 가로 30cm의 편지지가 필요합니다. 입출력 예 #2 message의 글자 수가 11개로 최소 가로 22cm의 편지지가 필요합니다. ..

모음으로 시작하는 관측소의 도시 목록 Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. SELECT city FROM station WHERE (city LIKE 'a%' OR city LIKE 'e%' OR city LIKE 'i%' OR city LIKE 'o%' OR city LIKE 'u%')..

특정 위도보다 작은 수 중 가장 큰 값 Query the greatest value of the Northern Latitudes (LAT_N) from STATION that is less than. Truncate your answer to decimal places. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. SELECT ROUND(MAX(lat_n), 4) FROM station WHERE lat_n < 137.2345 ; 예시에 주어진 137.2345의 자릿수 조건에 맞추기 위해 ROUND를 사용하여 동일한 ..

도시에 속한 전체 관측소 개수와 관측소가 있는 도시의 개수 차이 Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table. The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. For example, if there are three records in the table with CITY values 'New York', 'New York', 'Bengalaru', there are ..

위도 경도의 총합 Query the following two values from the STATION table: The sum of all values in LAT_N rounded to a scale of decimal places. The sum of all values in LONG_W rounded to a scale of decimal places. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. Output Format Your results must be in the form: lat lon where is..

특정 월급 이하인 신입의 이름 조회 Write a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than per month who have been employees for less than months. Sort your result by ascending employee_id. Input Format The Employee table containing employee data for a company is described as follows: where employee_id is an employee's ID number, name..

정렬된 직원 이름 조회 Write a query that prints a list of employee names (i.e.: the name attribute) from the Employee table in alphabetical order. Input Format The Employee table containing employee data for a company is described as follows: where employee_id is an employee's ID number, name is their name, months is the total number of months they've been working for the company, and salary is their mon..
문제 설명 정수 n이 매개변수로 주어질 때, n의 약수를 오름차순으로 담은 배열을 return하도록 solution 함수를 완성해주세요. 제한사항 1 ≤ n ≤ 10,000 입출력 예 설명 입출력 예 #1 24의 약수를 오름차순으로 담은 배열 [1, 2, 3, 4, 6, 8, 12, 24]를 return합니다. 입출력 예 #2 29의 약수를 오름차순으로 담은 배열 [1, 29]를 return합니다. import java.util.*; class Solution { public ArrayList solution(int n) { ArrayList answer = new ArrayList(); for(int i=1; i