[시뮬레이션 & 구현] 좌석번호
[문제] [내가 푼 것] import java.util.*; class Solution4 { public int[] solution(int c, int r, int k){ int[] answer = new int[2]; int[][] seat = {}; // 배열 초기화 for(int i = 0; i < c; i++) { for(int j = 0; j < r; j++) { seat[i][j] = 0; } } // 이동방향 정하는 배열 int dx[] = {-1, 0, 1, 0}; int dy[] = {0, 1, 0, -1}; int d = 1; int x = 0, y = 0; int count = 0; while(count < k) { count++; int nx = 0, ny = 0; nx = x + ..
[시뮬레이션 & 구현] 잃어버린 강아지
[문제] [처음 푼 것] import java.util.*; class Solution3 { public int solution(int[][] board){ int answer = 0; int count = 0; // 이동방향을 정하기 위한 배열 (12시, 3시, 6시, 9시 방향) int[] dx = {-1, 0, 1, 0}; int[] dy = {0, 1, 0, -1}; // 배열 인덱스 int d1 = 0; int d2 = 0; // 현수와 강아지 초기 위치 변수 int x1 = 0, y1 = 0, x2 = 0, y2 = 0; // 현수와 강아지 위치 초기화 for(int[] line : board) { for(int k : line) { if(line[k] == 2) { x1 = k; } if(k..
[시뮬레이션 & 구현] 청소
[문제] [처음 생각한 것] import java.util.*; class Solution { public int[] solution(int[][] board, int k){ int[] answer = new int[2]; for(int i = 0 ; i < k ; i++) { for(int[] line : board) { for(int k : line) { if(answer[i] == 1 || answer[i] == board.length) { } } } } return answer; } public static void main(String[] args){ Solution T = new Solution(); int[][] arr1 = {{0, 0, 0, 0, 0}, {0, 1, 1, 0, 0}, {0..
웹 개발 개론 (REST API, URI 설계 패턴, HTTP Protocol)
Web이란 ? World Wide Web(WWW, W3)은 인터넷에 연결된 컴퓨터를 통해 사람들이 정보를 공유할 수 있는 전 세계적인 정보 공간 Web의 용도 - Web Site : google, nave, daum, facebook 등 HTML로 구성된 여러 사이트들 - API(Application Programming Interface) * Web Service : Kakao Open API, Google Open API, Naver Open API 등 - User Interface : Chrome, Safari, Explorer, Smart Watch, IP TV 등 Web의 기본 3가지 요소 - URI (Uniform Resource Identifier) 리소스 식별자 모든 정보에 접근할 수 있는..