일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 프리미티브 타입
- Java
- 정렬
- Study Halle
- 항해99
- 자바스터디
- Effective JAVA
- github api
- annotation processor
- auto.create.topics.enable
- 자바할래
- System.in
- 스파르타코딩클럽
- raw 타입
- 로컬 클래스
- 익명 클래스
- 함수형 인터페이스
- System.out
- 제네릭 타입
- 합병 정렬
- 브릿지 메소드
- public 필드
- Switch Expressions
- 접근지시자
- 제네릭 와일드 카드
- 바운디드 타입
- junit 5
- 람다식
- 상속
- System.err
Archives
- Today
- Total
코딩하는 털보
11 to 9, Day 15 본문
Today, ToDoList
- 이력서 만들기
- 코딩 문제 풀기
나의 새로운 이력서 페이지...
https://www.notion.so/Let-the-work-begin-d36ddab688774e179e80ea6959d5fca6
정원희 님의 블로그에 있는 이력서 작성법 포스팅을 참고해서 작성하였다.
https://wonny.space/writing/work/engineer-resume
- Two Sum
Given an array of integers nums
and an integer target
, return indices of the two numbers such that they add up to target
.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
int 배열에서 합이 특정 값이 되는 두 값의 index 배열 반환
Example 1:
Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Output: Because nums[0] + nums[1] == 9, we return [0, 1].
Example 2:
Input: nums = [3,2,4], target = 6
Output: [1,2]
Example 3:
Input: nums = [3,3], target = 6
Output: [0,1]
class Solution {
public static int[] twoSum(int[] nums, int target) {
int num1;
int num2;
int[] result = new int[2];
for (int i = 0; i < nums.length; i++) {
num1 = nums[i];
for (int j=i+1; j < nums.length; j++) {
num2 = nums[j];
if ( num1 + num2 == target ) {
result[0] = i;
result[1] = j;
return result;
}
}
}
return null;
}
}