전체 글(368)
-
[프로그래머스/Kotlin]Lv3 - 디스크 컨트롤러
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 문제 설명 하드디스크는 한 번에 하나의 작업만 수행할 수 있습니다. 디스크 컨트롤러를 구현하는 방법은 여러 가지가 있습니다. 가장 일반적인 방법은 요청이 들어온 순서대로 처리하는 것입니다. 예를들어 `0ms 시점에 3ms가 소요되는 A작업 요청 1ms 시점에 9ms가 소요되는 B작업 요청 2ms 시점에 6ms가 소요되는 C작업 요청` 와 같은 요청이 들어왔습니다. 이를 그림으로 표현하면 아래와 같습니다. 한 번에 하나의 요청만을 수행할 수 있기 때문에 각각의 작업을 요청받은 순서대로 처리하면 다음과 같이..
2023.08.06 -
[프로그래머스/Kotlin]Lv3 - 불량 사용
프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 문제 설명 개발팀 내에서 이벤트 개발을 담당하고 있는 "무지"는 최근 진행된 카카오이모티콘 이벤트에 비정상적인 방법으로 당첨을 시도한 응모자들을 발견하였습니다. 이런 응모자들을 따로 모아 불량 사용자라는 이름으로 목록을 만들어서 당첨 처리 시 제외하도록 이벤트 당첨자 담당자인 "프로도" 에게 전달하려고 합니다. 이 때 개인정보 보호을 위해 사용자 아이디 중 일부 문자를 '' 문자로 가려서 전달했습니다. 가리고자 하는 문자 하나에 '' 문자 하나를 사용하였고 아이디 당 최소 하나 이상의 '*' 문자를 사용..
2023.08.05 -
[LeetCode/Kotlin]Medium - 53. Maximum Subarray
Maximum Subarray - LeetCode Can you solve this real interview question? Maximum Subarray - Given an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: The subarray [4,-1,2,1] has t leetcode.com 문제 Given an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: ..
2023.08.03 -
[LeetCode/Kotlin]Medium - 200. Number of Islands
Number of Islands - LeetCode Can you solve this real interview question? Number of Islands - Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by water and is formed by connecting adjacent l leetcode.com 문제 Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), retur..
2023.08.03 -
[LeetCode/Kotlin]Medium - 926. Flip String to Monotone Increasing
Flip String to Monotone Increasing - LeetCode Can you solve this real interview question? Flip String to Monotone Increasing - A binary string is monotone increasing if it consists of some number of 0's (possibly none), followed by some number of 1's (also possibly none). You are given a binary string leetcode.com Problem A binary string is monotone increasing if it consists of some number of 0'..
2023.07.16 -
[LeetCode/Kotlin]Medium - 17. Letter Combinations of a Phone Number
Letter Combinations of a Phone Number - LeetCode Can you solve this real interview question? Letter Combinations of a Phone Number - Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of d leetcode.com Problem Given a string containing digits from 2-9 inclusive, return all possibl..
2023.07.16