반응형

전체 글 223

[프로그래머스 C#] N개의 최소공배수

https://programmers.co.kr/learn/courses/30/lessons/12953 코딩테스트 연습 - N개의 최소공배수 두 수의 최소공배수(Least Common Multiple)란 입력된 두 수의 배수 중 공통이 되는 가장 작은 숫자를 의미합니다. 예를 들어 2와 7의 최소공배수는 14가 됩니다. 정의를 확장해서, n개의 수의 최소공배 programmers.co.kr public class Solution { public int solution(int[] arr) { int answer = LeastCommonMultiple(arr); return answer; } int LeastCommonMultiple(int[] arr) { int lcm = 1; bool isFinished ..

[프로그래머스 C#] 8주차_최소직사각형

https://programmers.co.kr/learn/courses/30/lessons/86491 코딩테스트 연습 - 8주차_최소직사각형 [[10, 7], [12, 3], [8, 15], [14, 7], [5, 15]] 120 [[14, 4], [19, 6], [6, 16], [18, 7], [7, 11]] 133 programmers.co.kr using System; public class Solution { public int solution(int[,] sizes) { int answer = OptimalSize(sizes); return answer; } int OptimalSize(int[,] sizes) { int maxW = 0, maxH = 0; for (int i = -1; ++i ..

[프로그래머스 C#] 나머지가 1이 되는 수 찾기

https://programmers.co.kr/learn/courses/30/lessons/87389 코딩테스트 연습 - 나머지가 1이 되는 수 찾기 자연수 n이 매개변수로 주어집니다. n을 x로 나눈 나머지가 1이 되도록 하는 가장 작은 자연수 x를 return 하도록 solution 함수를 완성해주세요. 답이 항상 존재함은 증명될 수 있습니다. 제한사항 입 programmers.co.kr using System; public class Solution { public int solution(int n) { int answer = 0; for (int i = 1; ++i < n - 1;) if (n % i == 1) { answer = i; break; } if (answer == 0) answer =..

[프로그래머스 C#] 없는 숫자 더하기

https://programmers.co.kr/learn/courses/30/lessons/86051 코딩테스트 연습 - 없는 숫자 더하기 0부터 9까지의 숫자 중 일부가 들어있는 배열 numbers가 매개변수로 주어집니다. numbers에서 찾을 수 없는 0부터 9까지의 숫자를 모두 찾아 더한 수를 return 하도록 solution 함수를 완성해주세요. 제한 programmers.co.kr using System; using System.Linq; public class Solution { public int solution(int[] numbers) { int answer = 0; for (int i = 0; ++i < 10;) answer += i; answer -= numbers.Sum(); r..

[프로그래머스 C#] 6주차_복서 정렬하기

https://programmers.co.kr/learn/courses/30/lessons/85002 코딩테스트 연습 - 6주차_복서 정렬하기 복서 선수들의 몸무게 weights와, 복서 선수들의 전적을 나타내는 head2head가 매개변수로 주어집니다. 복서 선수들의 번호를 다음과 같은 순서로 정렬한 후 return 하도록 solution 함수를 완성해주세요 programmers.co.kr using System; using System.Collections.Generic; using System.Linq; public class Solution { public int[] solution(int[] weights, string[] head2head) { int _length = weights.Lengt..

오늘의 영어

I will get my second does of vaccine today. - 나는 2차 백신을 맞을 거에요 오늘. I am fully vaccinated now. - 나는 백신 접종을 완료 했어요. There was no spot for me. - 나를 위한 자리가 없었어요. -> 주차장에 자리가 없어서 껄껄... I felt pain in my right arm. - 오른쪽 팔이 아팠어요. (나는 느꼈다 아픔을 오른팔의) It was so painful that I want to cut them out. - 너무 아파서 잘라버리고 싶었어용ㅋㅋㅋ ​Which would you like for dinner, beef or fish? - 저녁으로 고기와 생선 요리 중 어느 것이 좋니? I would l..

영어공부 2021.10.07

오늘의 영어

We need time to hang out with friends. - 우리는 필요하다 시간이 친구들과 놀 수 있는 * hang out - 놀다 tipsy - 알딸딸한 I didn't have choice. - 어쩔 수 없었다. ( dog - 개고기 dogs - 강아지 == a dog -> cat - 고양이 고기,,,, cats - 고양이 == a cat -> chicken - 치킨 chickens - 닭 ** Do you like dog? -> 개고기 좋아해? 요런 느낌... 2. 병 느낌으로 보면 -> headache a headache -> flu a flu -> colon cancer(대장암) a colon cancer -> diabetes(당뇨병) a diabetes ** a를 붙이면 좀 증상..

영어공부 2021.10.02

오늘의 영어

What has the woman finished? - 여자는 무엇을 끝냈습니까? -> The woman finished her meal. => The woman has finished her meal. * has p.p - 여자는 식사를 마쳤다. (현재 완료 형으로 물어봤으니까 현재 완료로 대답) Who wants to pay for the meal? - 누가 원하냐 지불하기를 식사에 대한? => Both of them want to pay for the meal. - 양쪽 다 식사에 대한 지불을 원한다. How will they split the bill? - 그들은 계산서를 어떻게 나눌 것인가? -> They will split the bill 50:50. - 그들은 나눌 것이다 계산을 반반씩. W..

영어공부 2021.09.27

오늘의 영어

​I had to stay up all night working. - 밤새 일해야 했습니다. Can I have a doggie bag(= doggy bag)? - 포장해갈 만한 용기(비닐봉투 같은)거 있나요? * doggie bag보단 to go box를 사용하는게 더 좋을 듯 => Can I have to go box? - to go box를 하나의 명사로 생각하면 됨 * 식당이든 카페 등등 에서 먹고가 아님 가져가? 표현할 때 to go or here? - take out X -> take away => Can I take the food away? - 음식 포장 가능한가요? Here you are. 의 여러 표현들 -> Here you go. = There you go. = There you ar..

영어공부 2021.09.25

오늘의 영어

- 식당에서 사용하는 - Are you finished? - 식사 다 하셨어요? I think so. - 그런 거 같아용. Can I have the bill, please? - 계산서 주실래요? Here you go. -여기 있습니다. Is this separate or together? - 각자 or 같이? (계산) We are going 50-50 on this one. - 우리는 반반씩 할 거예요 이것을. Did you enjoy your mill? - 식사 맛있게 하셨나요? I enjoyed it a lot. - 나는 즐겼다 그것을 많이 -> 맛있게 먹었따! Do you accept American Express? - 아메리칸 익스프레스 카드를 사용 가능할까요? * bill - 청구서 * dog..

영어공부 2021.09.14
반응형