목록전체 글 (956)
넘치게 채우기
https://leetcode.com/problems/partition-list/description/ Partition List - LeetCode Can you solve this real interview question? Partition List - Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the no leetcode.com 문제 유형 : 연결 리스트 문제 난이도 : Medium 문제 Given the ..
https://leetcode.com/problems/container-with-most-water/description/?envType=study-plan-v2&envId=top-interview-150 Container With Most Water - LeetCode Can you solve this real interview question? Container With Most Water - You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines ..
https://leetcode.com/problems/check-if-there-is-a-valid-partition-for-the-array/description/ Check if There is a Valid Partition For The Array - LeetCode Can you solve this real interview question? Check if There is a Valid Partition For The Array - You are given a 0-indexed integer array nums. You have to partition the array into one or more contiguous subarrays. We call a partition of the arra..
https://leetcode.com/problems/unique-paths-ii/description/ Unique Paths II - LeetCode Can you solve this real interview question? Unique Paths II - You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - leetcode.com 문제 유형 : 동적 계획법(다이나믹 프로그래밍) 문제 난이도 : Medium..
https://leetcode.com/problems/coin-change-ii/description/ Coin Change II - LeetCode Can you solve this real interview question? Coin Change II - You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the number of combinations that make up that leetcode.com 문제 유형 : 다이나믹 프로그래밍 (동적계획법) 문제 난이도 : Medium 문제..
https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/?envType=study-plan-v2&envId=top-interview-150 Two Sum II - Input Array Is Sorted - LeetCode Can you solve this real interview question? Two Sum II - Input Array Is Sorted - Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific targ..
이 장에서는 깨끗한 클래스를 다룹니다. 클래스 체계 클래스를 정의하는 표준 자바 관리에 따르면, 가장 먼저 변수 목록이 나옵니다. 정적(static) 공개(public) 상수가 있다면 맨 처음에 나옵니다. 그 다음 정적 비공개(private) 변수, 이어서 비공개 인스턴스 변수가 나옵니다. 공개 변수가 필요한 경우는 거의 없습니다. 변수 목록 다음에는 공개 함수가 나옵니다. 비공개 함수는 자신을 호출하는 공개 함수 직후에 넣습니다. 즉, 추상화 단계가 순차적으로 내려갑니다. 그래서 프로그램은 신문 기사처럼 읽히는 것 입니다. 캡슐화 변수와 유틸리티 함수는 가능한 공개하지 않는 편이 낫지만, 반드시 숨겨야 한다는 법칙도 없습니다. 때로는 변수나 유틸리티 함수를 protected로 선언해 테스트 코드에 접근..
https://leetcode.com/problems/valid-palindrome/description/?envType=study-plan-v2&envId=top-interview-150 Valid Palindrome - LeetCode Can you solve this real interview question? Valid Palindrome - A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric cha leetcod..
1997년만 해도 TDD(Test Driven Development)라는 개념을 아무도 몰랐습니다. 우리 대다수에게 단위 테스트란, 자기의 프로그램이 ‘돌아간다’라는 사실만 확인하는 일회성 코드에 불과했습니다. 지금은 애자일과 TDD 덕분에 단위 테스트를 자동화하는 프로그래머들이 이미 많아졌으며, 점점 늘어나는 추세입니다. TDD 법칙 세 가지 첫째 법칙 : 실패하는 단위 테스트를 작성할 때까지 실제 코드를 작성하지 않는다. 둘째 법칙 : 컴파일은 실패하지 않으면서 실행이 실패하는 정도로만 단위 테스트를 작성한다. 셋째 법칙 : 현재 실패하는 테스트를 통과할 정도로만 실제 코드를 작성한다. 위 세 가지 규칙을 따르면 개발과 테스트가 대략 30초 주기로 묶입니다. 테스트 코드와 실제 코드가 함께 나올뿐더러..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bd0ooQ/btsqtV1p5ag/CXNqWzpraMbjkNnlIVN2uK/img.png)
https://leetcode.com/problems/search-in-rotated-sorted-array/description/ Search in Rotated Sorted Array - LeetCode Can you solve this real interview question? Search in Rotated Sorted Array - There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 nums[i+1] || target < nums[i..