
class Solution {
public int solution(int[] dot) {
int answer = 0;
if (dot[0] > 0 && dot[1] > 0) {
answer = 1;
} else if (dot[0] < 0 && dot[1] > 0) {
answer = 2;
} else if (dot[0] < 0 && dot[1] < 0) {
answer = 3;
} else {
answer = 4;
}
return answer;
}
}

class Solution {
public int[][] solution(int[] num_list, int n) {
int numRows = num_list.length / n;
int[][] answer = new int[numRows][n];
int index = 0;
for (int i = 0; i < numRows; i++) {
for (int j = 0; j < n; j++) {
// num_list 배열에서 순서대로 가져와서 2차원 배열에 값 채우기
answer[i][j] = num_list[index++];
}
}
return answer;
}
}
class Solution {
public int[][] solution(int[] num_list, int n) {
int[][] answer = {};
int length = num_list.length;
answer = new int[length/n][n];
for(int i=0; i<length; i++){
// 2차원 배열에 나눈 몫과 나머지 값을 추가
answer[i/n][i%n]=num_list[i];
}
return answer;
}
}

class Solution {
public int solution(int[] numbers, int k) {
int index = 2 * (k - 1);
return numbers[index % numbers.length];
}
}
한명을 건너띄고 던지므로 인덱스는 2씩 증가하고
첫번째에 공을 던지는 것은 항상 0번 인덱스이므로 (k-1) 이다.

class Solution {
public int[] solution(int[] numbers, String direction) {
int[] answer = new int[numbers.length];
if(direction.equals("right")){
for(int i = 0; i < answer.length - 1; i++){
answer[i + 1] = numbers[i];
}
answer[0] = numbers[numbers.length -1];
}else {
for(int i = 0; i < answer.length - 1; i++){
answer[i] = numbers[i + 1];
}
answer[answer.length - 1] = numbers[0];
}
return answer;
}
}