문제 설명두 정수 a, b가 주어졌을 때 a와 b 사이에 속한 모든 정수의 합을 리턴하는 함수, solution을 완성하세요. 예를 들어 a = 3, b = 5인 경우, 3 + 4 + 5 = 12이므로 12를 리턴합니다.제한 조건a와 b가 같은 경우는 둘 중 아무 수나 리턴하세요.a와 b는 -10,000,000 이상 10,000,000 이하인 정수입니다.a와 b의 대소관계는 정해져있지 않습니다.입출력 예abreturn35123335312 Solution in Java 123456789101112131415161718class Solution { public long solution(int a, int b) { long answer = 0; if(a = b; i--){ answer = i + answer;..
DI Dependency Injection 의존성 주입 - IoC (Inversion of Control) and DI are used to be interchangeable. - A programmer is central to the program, but the control of the entire program is the framework. - Inject bean by assembler not Object itself - Spring Container create Bean and control the life cycle of it. Example Code I public class Person{ private Writer text; public Person() { text = new Anoth..
Upcasting Upcasting is casting from a subclass to superclass. When a superclass variable contains a reference to a subclass object, and that reference is used to call a method, the subclass version of the method is called. Student s = new Student (); Person p = (person)s; ↓ Person p = new Student();Reference variable object Upcasting happens if you want to reuse your code that knows about the su..
@SpringBootConfiguration - @Configuration과 같음. Bean을 등록하는 Java 설정파일(@Component, @Service, @Repository, @Controller, @Configuration annotation 이 붙은 method 를 @Autowired로 bean을 생성할 수 있다.)이며 @Configuration 자신도 bean으로 등록된다. @ComponentScan - The first stage to read Bean. - @Component,@Configuration,@Repository,@Service,@Controller,@RestController 를 가진 Class 들을 scan해서 bean으로 등록한다. - 다 같은 이름으로 하지 않고 저렇게..
같은 숫자는 싫어 문제 설명 배열 arr가 주어집니다. 배열 arr의 각 원소는 숫자 0부터 9까지로 이루어져 있습니다. 이때, 배열 arr에서 연속적으로 나타나는 숫자는 하나만 남기고 전부 제거하려고 합니다. 배열 arr에서 제거 되고 남은 수들을 return 하는 solution 함수를 완성해 주세요. 단, 제거된 후 남은 수들을 반환할 때는 배열 arr의 원소들의 순서를 유지해야 합니다. 예를들면 arr = [1, 1, 3, 3, 0, 1, 1] 이면 [1, 3, 0, 1] 을 return 합니다. arr = [4, 4, 4, 3, 3] 이면 [4, 3] 을 return 합니다. 배열 arr에서 연속적으로 나타나는 숫자는 제거하고 남은 수들을 return 하는 solution 함수를 완성해 주세요...
문제 설명 대문자와 소문자가 섞여있는 문자열 s가 주어집니다. s에 'p'의 개수와 'y'의 개수를 비교해 같으면 True, 다르면 False를 return 하는 solution를 완성하세요. 'p', 'y' 모두 하나도 없는 경우는 항상 True를 리턴합니다. 단, 개수를 비교할 때 대문자와 소문자는 구별하지 않습니다. 예를들어 s가 pPoooyY 면 true를 return하고 Pyy 라면 false를 return합니다. 제한사항 문자열 s의 길이 : 50 이하의 자연수 문자열 s는 알파벳으로만 이루어져 있습니다. 입출력 예 s answer pPoooyY true Pyy false Solution in Java public class Main { public static void main(String[..
- Total
- Today
- Yesterday
- 프로그래머스 알고리즘문제
- Object type casting
- 알고리즘
- hackerrank
- substring()
- algorithm
- javascript
- compareTo()
- rest parameter
- C++
- math.max
- java
- repeat()
- 프로그래머스
- spring boot application
- Javascript Algorithm
- equals()
- hackerrank javascript solution
- easy algorithm
- easy javascript algorithm
- 프로그래머스 알고리즘
- hackerrank solution
- code refactoring
- HashMap
- hackerrank javascript
- HackerRank Algorithm
- ... in Javascript
- Collection Framework
- math.abs
- string class in java
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |