전체 글 146

[leetcode] 78. Subsets (medium)

https://leetcode.com/problems/subsets/ Subsets - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 재귀(dfs)를 통해 모든 경우의 수를 조합하는 문제였다. 다만, 일반적인 프로그래머스나 백준과 다르게 공집합을 포함하여서 풀어야한다는 점. list.add(new ArrayList()); 그리고 반환문에서 list에 값을 더해줄때도 list.add(new ArrayList(ans)); - 그 이유는 이미 있는값에 더해질때, 덮어..

Algorithm Study 2022.09.13

[leetcode] Array- Merge Sorted Array

https://leetcode.com/explore/learn/card/fun-with-arrays/525/inserting-items-into-an-array/3253/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com 나.. 영어가 딸리는 것 같다 ㅎ.. 0을 제외한 m,n 의 숫자만큼의 배열값들을 가져오는 것으로 이해하고 풀었었는데 , 그런내용이 아..

Algorithm Study 2022.09.11

[leetcode] Array - Duplicate ZerosSolution

https://leetcode.com/explore/learn/card/fun-with-arrays/525/inserting-items-into-an-array/3245/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com 배열의 값이 0 이면, 그다음 인덱스도 0으로 넣고 배열을 오른쪽 밀어넣는 문제. for문으로 풀다보니, 검사한 idx인지 확인이 필요..

Algorithm Study 2022.09.11

[leetcode] Array- Find Numbers with Even Number of Digits

https://leetcode.com/explore/learn/card/fun-with-arrays/521/introduction/3237/ Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com even number : 짝수 / odd number : 홀수 배열 값 길이가 짝수인 갯수를 리턴하는 문제. ex. 12 -> 2자리 숫자. 2는 짝수

Algorithm Study 2022.09.10

[쿠팡 코딩테스트 후기]

1. 시뮬레이션- 배송여부로 재고 O,X,? 확인하는 문제 - 따져줘야하는게 은근 맣아서 1시간 20분정도 걸렸다. - 테스트케이스 다맞음. 2. 시뮬레이션? 시간초과 까다로운문제 - 소수의 곱의 결과가 나오는지 확인하는 문제 - ex. 6= 2*3 (2,3 소수로 곱하기 가능한 숫자.) - 제곱근까지만 판별해야 시간초과가 안났다. - 기존에 제곱근이라는 것을 풀어본적이 있어서 맞았지만 아니였으면 꽤나 고생했을 문제 - 40분정도 걸렸다. -테스트 케이스 다맞음. 3. DFS - 같은 숫자끼리 이동하는 문제 (하지만, 기본적인 유형이랑 조금다름) - 기본적인 DFS문제는 같은 숫자끼리 이동할수있는 모든 범위를 다 체크하지만, 이거는 한번 이동하면 끝이다. 그래서 어떤 x,y좌표에서 움직였을때 가장 큰 범..

Dairy 2022.08.21

[프로그래머스] 오픈채팅방(level.2) / Java, HashMap

https://school.programmers.co.kr/learn/courses/30/lessons/42888?language=java 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 뭔가 문제는 글이 많아서 되게 읽기 싫게 생겼는데 막상 풀어보니 은근 간단한 문제였다. 30분걸렸고 맞췄다! (잘하는사람은 진짜 바로풀듯.. !) 풀이방법 1. 아이디와 닉네임을 저장할 HashMap - 아이디와 닉네임이 바뀔수 있는 경우는 Enter 명령어 이거나, Change 명령어를 사용했을 경우이다. - Enter이거나 Change인 경우, HashMap에 Name..

Algorithm Study 2022.08.20

객체지향의 설계 원칙 5가지 (SOLID)

SOLID 클린코드로 유명한 로버트 마틴이 좋은 객체 지향 설계의 5가지 원칙을 정리 SRP : 단일 책임 원칙 ( single reponsibility principle) OCP : 개방-폐쇄 원칙 ( Open/ closed principle) LSP : 리스코프 치환 원칙 (Liskov substitution principle) ISP : 인터페이스 분리 원칙 (Interface segregation principle) DIP : 의존관계 역전 원칙 (Dependency inversion principle) SRP : 단일 책임 원칙 ( single reponsibility principle) 한 클래스는 하나의 책임만 가져야 한다. 하나의 책임이라는 것은 모호하다. 클 수도 있고, 작을 수도 있으며..

이직준비/CS 2022.07.28

객체 지향의 특징 ( 추상화/ 캡슐형/ 상속/ 다형성)

1. 추상화 불필요한 부분을 제거한다. 인터페이스와 구현을 분리한다. 2. 캡슐형 데이터 캡슐화 : 필드와 메서드를 하나로 묶는 것 은닉화 : 객체의 세부내용이 외부에 드러나지 않도록 private으로 접근제한을 두어, 외부에서 데이터를 직접 접근하는 것을 방지한다. 3. 상속 https://hyun-1200.tistory.com/98 상속(inheritance) / 포함(Composite) 관계 상속 : 기존의 클래스를 재사용하여 새로운 클래스를 작성하는 것 장점 코드의 재사용성을 높이고 코드의 중복을 제거하여 프로그램의 생산성을 높이고 유지보수를 편리하게 한다. 사용법 - exte hyun-1200.tistory.com 4. 다형성 https://hyun-1200.tistory.com/103 다형성(..

이직준비/CS 2022.07.28