목록전체 글 (188)
forest_moon
문제 설명 my_string은 "3 + 5"처럼 문자열로 된 수식입니다. 문자열 my_string이 매개변수로 주어질 때, 수식을 계산한 값을 return 하는 solution 함수를 완성해주세요. 제한사항 연산자는 +, -만 존재합니다. 문자열의 시작과 끝에는 공백이 없습니다. 0으로 시작하는 숫자는 주어지지 않습니다. 잘못된 수식은 주어지지 않습니다. 5 ≤ my_string의 길이 ≤ 100 my_string을 계산한 결과값은 1 이상 100,000 이하입니다. my_string의 중간 계산 값은 -100,000 이상 100,000 이하입니다. 계산에 사용하는 숫자는 1 이상 20,000 이하인 자연수입니다. my_string에는 연산자가 적어도 하나 포함되어 있습니다. return type 은 정..
문제 설명 정수 배열 array가 매개변수로 주어질 때, 가장 큰 수와 그 수의 인덱스를 담은 배열을 return 하도록 solution 함수를 완성해보세요. 제한사항 1 ≤ array의 길이 ≤ 100 0 ≤ array 원소 ≤ 1,000 array에 중복된 숫자는 없습니다. 입출력 예 설명 입출력 예 #1 1, 8, 3 중 가장 큰 수는 8이고 인덱스 1에 있습니다. 입출력 예 #2 9, 10, 11, 8 중 가장 큰 수는 11이고 인덱스 2에 있습니다. class Solution { public int[] solution(int[] array) { int[] answer = new int[2]; int max = 0; int index = 0; for(int i=0; i max){ max = arr..
문제 설명 머쓱이는 할머니께 생신 축하 편지를 쓰려고 합니다. 할머니가 보시기 편하도록 글자 한 자 한 자를 가로 2cm 크기로 적으려고 하며, 편지를 가로로만 적을 때, 축하 문구 message를 적기 위해 필요한 편지지의 최소 가로길이를 return 하도록 solution 함수를 완성해주세요. 제한사항 공백도 하나의 문자로 취급합니다. 1 ≤ message의 길이 ≤ 50 편지지의 여백은 생각하지 않습니다. message는 영문 알파벳 대소문자, ‘!’, ‘~’ 또는 공백으로만 이루어져 있습니다. 입출력 예 설명 입출력 예 #1 message의 글자 수가 15개로 최소 가로 30cm의 편지지가 필요합니다. 입출력 예 #2 message의 글자 수가 11개로 최소 가로 22cm의 편지지가 필요합니다. ..
올해는 구체적인 계획을 세워서 해결 해 낼꺼고 또 3달의 여유가 생긴만큼 후회하지 않을 만큼 시간을 활용해야겠다. 2023도 즐겨보자.
모음으로 시작하는 관측소의 도시 목록 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..