본문 바로가기

전체 글

(17)
CodingBat Java: Array-3 (linearIn) Given two arrays of ints sorted in increasing order, outer and inner, return true if all of the numbers in inner appear in outer. The best solution makes only a single "linear" pass of both arrays, taking advantage of the fact that both arrays are already in sorted order. linearIn([1, 2, 4, 6], [2, 4]) → true linearIn([1, 2, 4, 6], [2, 3, 4]) → false linearIn([1, 2, 4, 4, 6], [2, 4]) → true Solu..
스프링 핵심원리 기본편 - 6-1. 다양한 의존관계 주입 방법 보호되어 있는 글입니다.
스프링 핵심원리 기본편 - 5. 컴포넌트 스캔 보호되어 있는 글입니다.
CodingBat Java: String-3 (mirrorEnds) Given a string, look for a mirror image (backwards) string at both the beginning and end of the given string. In other words, zero or more characters at the very begining of the given string, and at the very end of the string in reverse order (possibly overlapping). For example, the string "abXYZba" has the mirror end "ab". mirrorEnds("abXYZba") → "ab" mirrorEnds("abca") → "a" mirrorEnds("aba") ..
CodingBat Java: Logic-2 (evenlySpaced) problem - Given three ints, a b c, one of them is small, one is medium and one is large. Return true if the three values are evenly spaced, so the difference between small and medium is the same as the difference between medium and large. evenlySpaced(2, 4, 6) → true evenlySpaced(4, 6, 2) → true evenlySpaced(4, 6, 3) → false Solution 이번 문제는 하나는 가장 작고, 하나는 중간값, 하나는 가장 큰 값으로 구성된 3개의 숫자가 주어진다. 그리고 ..
스프링 핵심원리 기본편 - 4. 싱글톤 컨테이너 보호되어 있는 글입니다.
스프링 핵심원리 기본편 - 3. 스프링 컨테이너와 스프링 빈 보호되어 있는 글입니다.
CodingBat Java: Warmup-2 (noTriples) problem - Given an array of ints, we'll say that a triple is a value appearing 3 times in a row in the array. Return true if the array does not contain any triples. noTriples([1, 1, 2, 2, 1]) → true noTriples([1, 1, 2, 2, 2, 1]) → false noTriples([1, 1, 1, 2, 2, 2, 1]) → false Solution 이번 문제는 연속된 세 개의 숫자를 가지는 배열일 경우 false를 반환하는 문제이다. 특별한 풀이과정은 없었으며, 배열의 인덱스를 전진하면서 연속된 세 개의 숫자가 있을 때까지 카운트하여 있으면 f..