2022/04 5

[프로그래머스] 수박수박수박수박수박수?

## Github URL : https://github.com/leewoopyo/coding_test/blob/master/programmers/Solution_12922.java GitHub - leewoopyo/coding_test Contribute to leewoopyo/coding_test development by creating an account on GitHub. github.com 1. 소스코드 public String solution(int n) { // 문자열을 추가로 붙일 StringBuilder를 선언 StringBuilder result = new StringBuilder(); // n/2 만큼 반복을 돌리면서 "수박" 을 붙임 for (int i = 0; i < n/2; i+..

[프로그래머스] 폰켓몬

## Github URL : https://github.com/leewoopyo/coding_test/blob/master/programmers/Solution_1845.java GitHub - leewoopyo/coding_test Contribute to leewoopyo/coding_test development by creating an account on GitHub. github.com 1. 소스코드 public int solution(int[] nums) { // List로 Set을 구성함으로서 중복데이터 제거 HashSet set = new HashSet(); // set에 nums의 데이터 삽입 (중복된 데이터가 들어가도 set구조에선 중복데이터가 쌓이지 않음) for (int i : n..

[Java] Array 중복 제거

## Github 주소 https://github.com/leewoopyo/java-logic-tests remove_duplication 패키지 GitHub - leewoopyo/java-logic-tests: java-logic-tests java-logic-tests. Contribute to leewoopyo/java-logic-tests development by creating an account on GitHub. github.com 1. Array를 Set으로 변환 후 다시 Array로 변환 Set은 중복을 허용하지 않기 때문에 중복이 있는 Array를 Set으로 변환 시 중복이 제거됨 LinkedSet 은 순서가 보장되는 Set이다 1-1 Array Set // 배열을 HashSet으로 ..

java 2022.04.04

[Java] Socket 통신, TCP Client 샘플

## Github 주소 : https://github.com/leewoopyo/tcp_sample GitHub - leewoopyo/tcp_sample Contribute to leewoopyo/tcp_sample development by creating an account on GitHub. github.com 1. 소켓이란? 소켓은 네트워크 상에서 돌아가는 두 개의 프로그램 간 양방향 통신의 엔드 포인트. 2. 앤드 포인트 여기에서의 앤드 포인트는 아이피 주소와 포트 번호의 조합을 의미함. 모든 TCP 연결은 2개의 앤드 포인트로 유일하게 식별되어질 수 있습니다. 3. 소켓 통신 소켓 통신이란 서버와 클라이언트 양방향 연결이 이루어지는 통신. 4. TCP (스트림 소켓) 연결형 (Connection..

java 2022.04.02

[Java] Socket 통신, Tcp Server 샘플

## Github 주소 : https://github.com/leewoopyo/tcp_sample GitHub - leewoopyo/tcp_sample Contribute to leewoopyo/tcp_sample development by creating an account on GitHub. github.com 1. 소켓이란? 소켓은 네트워크 상에서 돌아가는 두 개의 프로그램 간 양방향 통신의 엔드 포인트. 2. 앤드 포인트 여기에서의 앤드 포인트는 아이피 주소와 포트 번호의 조합을 의미함. 모든 TCP 연결은 2개의 앤드 포인트로 유일하게 식별되어질 수 있습니다. 3. 소켓 통신 소켓 통신이란 서버와 클라이언트 양방향 연결이 이루어지는 통신. 4. TCP (스트림 소켓) 연결형 (Connection..

java 2022.04.02