https://leetcode.com/problems/majority-element/?envType=study-plan-v2&envId=top-interview-150 Majority Element - LeetCode Can you solve this real interview question? Majority Element - Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists leetcode.com 🤣 문제 설명 주식의..
https://leetcode.com/problems/majority-element/?envType=study-plan-v2&envId=top-interview-150 Majority Element - LeetCode Can you solve this real interview question? Majority Element - Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists leetcode.com 🤣 문제 설명 n 크..
https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/?envType=study-plan-v2&envId=top-interview-150 Remove Duplicates from Sorted Array II - LeetCode Can you solve this real interview question? Remove Duplicates from Sorted Array II - Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place [https://en.wikipedia.org/wiki/In-place_algorithm] such..
https://leetcode.com/problems/remove-duplicates-from-sorted-array/?envType=study-plan-v2&envId=top-interview-150 Remove Duplicates from Sorted Array - LeetCode Can you solve this real interview question? Remove Duplicates from Sorted Array - Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place [https://en.wikipedia.org/wiki/In-place_algorithm] such that each..
https://leetcode.com/problems/remove-element/?envType=study-plan-v2&envId=top-interview-150 Remove Element - LeetCode Can you solve this real interview question? Remove Element - Given an integer array nums and an integer val, remove all occurrences of val in nums in-place [https://en.wikipedia.org/wiki/In-place_algorithm]. The order of the elements may be changed. Then r leetcode.com 🤣 문제 설명 정수..
필자는 자바 스프링 기술스택으로 백엔드 취업을 준비하고 있습니다. 기존에는 파이썬으로 코딩테스트를 준비했지만, 부쩍 자바로 시험봐야 하는 곳도 늘어나고 무엇보다 코딩테스트를 준비하며 자바에 대한 문법과 이해를 높이기 위해 자바로 다시 코딩테스트를 준비하려고 합니다. 때문에 아직 코드가 조금 미흡하더라도 이해해주시길 바랍니다. https://leetcode.com/problems/merge-sorted-array/description/?envType=study-plan-v2&envId=top-interview-150 Merge Sorted Array - LeetCode Can you solve this real interview question? Merge Sorted Array - You are give..
변경에 있어서 자유롭지 못 한 클래스는 분리해야한다. 문제는 클래스 안에서 변경의 이유를 찾는 것이 생각보다 어렵다는 점이다. 코드를 통해 변경의 이유를 파악할 수 있는 첫 번째 방법은 인스턴스 변수가 초기화 되는 시점을 살펴보는 것이다. 응집도가 높은 클래스는 인스턴스를 생성할 때 모든 속성을 함께 초기화하는 반면, 응집도가 낮은 클래스는 객체의 속성 중 일부만 초기화하고 일부는 초기화되지 않은 상태로 남겨진다. 함께 초기화되는 속성을 기준으로 코드를 분리해야한다. 코드를 통해 변경의 이유를 파악할 수 있는 두 번째 방법은 메서드들이 인스턴스 변수를 사용하는 방식을 살펴보는 것이다. 모든 메서드가 객체의 모든 속성을 사용한다면 클래스의 응집도는 높다고 볼 수 있다. 속성 그룹과 해당 그룹에 접근하는 메..