[프로그래머스] 콜라 문제 - Java
·
알고리즘/프로그래머스
https://school.programmers.co.kr/learn/courses/30/lessons/132267 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제 문제 설명 오래전 유행했던 콜라 문제가 있습니다. 콜라 문제의 지문은 다음과 같습니다. 정답은 아무에게도 말하지 마세요. 콜라 빈 병 2개를 가져다주면 콜라 1병을 주는 마트가 있다. 빈 병 20개를 가져다주면 몇 병을 받을 수 있는가? 단, 보유 중인 빈 병이 2개 미만이면, 콜라를 받을 수 없다. 문제를 풀던 상빈이는 콜라 문제의 완벽한 해답을 찾았습니다. 상빈이가 푼 방법은 아래 그림..
[LeetCode] 70. Climbing Stairs - Java
·
알고리즘/LeetCode
https://leetcode.com/problems/climbing-stairs/ Climbing Stairs - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Exam..
[LeetCode] 238. Product of Array Except Self - Java
·
알고리즘/LeetCode
https://leetcode.com/problems/product-of-array-except-self/ Product of Array Except Self - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. ..
[LeetCode] 121. Best Time to Buy and Sell Stock - Java
·
알고리즘/LeetCode
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ 문제 You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, ret..
[LeetCode] 217. Contains Duplicate - Java
·
알고리즘/LeetCode
https://leetcode.com/problems/contains-duplicate/ 문제 Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true Constraints: 1
HYOJUN
'algorythm' 태그의 글 목록 (15 Page)