목록분류 전체보기 (1207)
넘치게 채우기
https://school.programmers.co.kr/learn/courses/30/lessons/72412 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 프로그래머스 - 순위 검색 문제 유형 : 문자열 처리 / 해시 / 이진탐색 문제 난이도 : Level 2(이게...?) 문제 설명 [본 문제는 정확성과 효율성 테스트 각각 점수가 있는 문제입니다.] 카카오는 하반기 경력 개발자 공개채용을 진행 중에 있으며 현재 지원서 접수와 코딩테스트가 종료되었습니다. 이번 채용에서 지원자는 지원서 작성 시 아래와 같이 4가지 항목을 반드시 선택하도록 하였습니다...
https://leetcode.com/problems/determine-if-a-cell-is-reachable-at-a-given-time/solutions/ Determine if a Cell Is Reachable at a Given Time - LeetCode Can you solve this real interview question? Determine if a Cell Is Reachable at a Given Time - You are given four integers sx, sy, fx, fy, and a non-negative integer t. In an infinite 2D grid, you start at the cell (sx, sy). Each second, you must m..
여러 가지 의미로, 함수형 프로그래밍이라는 개념은 프로그래밍 그 자체보다 앞섰다. 이 패러다임에서 핵심이 되는 기반은 람다(lambda)계산법으로, 알론조 처지(Alonzo Church)가 1930년대에 발명했다. 정수를 제곱하기 25까지의 정수의 제곱을 출력하는 간단한 문제를 다뤄보자. 자바 언어라면 아래처럼 작성할 수 있다. public class Squint { public static void main(String args[]) { for(int i = 0; i < 25; i++) { System.out.println(i*i); } } 리스프에서 파생한 클로저(Clojure)는 함수형 언어로, 클로저를 이용하면 같은 프로그램을 다음과 같이 구현한다. (println (take 25(map (fn ..
https://leetcode.com/problems/eliminate-maximum-number-of-monsters/description/ Eliminate Maximum Number of Monsters - LeetCode Can you solve this real interview question? Eliminate Maximum Number of Monsters - You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed integer array dist of size n, where dist[i] is the initi leetcode.com ..
객체 지향 프로그래밍. OOP(Object-Oriented-Programming)에서 이 OO의 본질을 설명하기 위해서 세 가지 주문에 기대곤 한다. 캡슐화(encapsulation) 상속(inheritance) 다형성(polymorphism) OO언어는 최소한 이 세가지를 충족해야한다고 한다. 캡슐화? OO를 정의하는 요소 중 하나로 캡슐화를 언급하는 이유는 데이터와 함수를 쉽고 효과적으로 캡슐화하는 방법을 OO언어가 제공하기 때문이다. 그리고 이를 통해 데이터와 함수가 응집력 있게 구성된 집단을 서로 구분 짓는 선을 그을 수 있다. 구분선 바깥에서 데이터는 은닉되고, 일부 함수만이 외부에 노출된다. 이 개념들이 실제 OO 언어에서는 private 멤버 데이터와 public 멤버 함수로 표현된다. 이러..
https://leetcode.com/problems/seat-reservation-manager/description/ Seat Reservation Manager - LeetCode Can you solve this real interview question? Seat Reservation Manager - Design a system that manages the reservation state of n seats that are numbered from 1 to n. Implement the SeatManager class: * SeatManager(int n) Initializes a SeatManager object that leetcode.com leetcode - Seat Reservati..
증명 데이크스트라가 초기에 인식한 문제: 프로그래밍은 어렵고, 프로그래머는 프로그래밍을 잘하지 못한다라는 사실. 모든 프로그램은 설령 단순할지 몰라도 인간의 두뇌로 감당하기에는 너무 많은 세부사항을 담고 있었다. 데이크스트라는 증명(proof)라는 수학적인 원리를 적용하여 이 문제를 해결하고자 했다. 수학자가 유클리드 계층구조를 사용하는 방식을 프로그래머도 사용할 수 있다고 믿었다. 데이크스트라는 이 연구를 진행하면서 goto 문장이 모듈을 더 작은 단위로 분해하는 과정에 방해가 도는 경우가 있다는 사실을 발견했고, 반면, goto문장을 사용하더라도 문제가 되지 않는 경우를 찾았다. if/then/else와 do/while과 같은 분기와 반복이라는 단순한 제어 구조에 해당한다는 사실을 발견했다. 그는 이..
https://leetcode.com/problems/find-the-winner-of-an-array-game/description/ Find the Winner of an Array Game - LeetCode Can you solve this real interview question? Find the Winner of an Array Game - Given an integer array arr of distinct integers and an integer k. A game will be played between the first two elements of the array (i.e. arr[0] and arr[1]). In each round of th leetcode.com leetcode..
이 장에서는 세 가지 패러다임인 구조적 프로그래밍(structured programming) 객체지향 프로그래밍(object-oriented programming) 함수형 프로그래밍(functional programming) 에 대해 설명한다. 구조적 프로그래밍 최초로 적용된 패러다임은 구조적 프로그래밍으로, 1968년 에츠허르 비버 데이크스트라(Edsger Wybve Dijkstra)가 발견했다. 데이크스트라는 무분별한 점프(goto문장)는 프로그램 구조에 해롭다는 사실을 제시했다. 데이크스트라는 이러한 점프들을 if/then/else 와 do/while/until과 같이 더 익숙한 구조로 대체했다. 구조적 프로그래밍은 다음과 같이 요약할 수 있다: “구조적 프로그래밍은 제어흐름의 직접적인 전환에 대해..
https://leetcode.com/problems/last-moment-before-all-ants-fall-out-of-a-plank/description/ Last Moment Before All Ants Fall Out of a Plank - LeetCode Can you solve this real interview question? Last Moment Before All Ants Fall Out of a Plank - We have a wooden plank of the length n units. Some ants are walking on the plank, each ant moves with a speed of 1 unit per second. Some of the ants move ..