본문 바로가기

PS25

73] Leetcode 2011. Final Value of Variable After Performing OperationsEasy1.1K151 #Kotlin https://leetcode.com/problems/final-value-of-variable-after-performing-operations/description/ Final Value of Variable After Performing Operations - LeetCode Can you solve this real interview question? Final Value of Variable After Performing Operations - There is a programming language with only four operations and one variable X: * ++X and X++ increments the value of the variable X by 1. * --X.. 2023. 4. 5.
71] Leetcode 2469. Convert the Temperature https://leetcode.com/problems/convert-the-temperature/description/ Convert the Temperature - LeetCode Can you solve this real interview question? Convert the Temperature - You are given a non-negative floating point number rounded to two decimal places celsius, that denotes the temperature in Celsius. You should convert Celsius into Kelvin and Fahrenheit a leetcode.com 주어진 값을 수식에 맞게 변형 후 리턴하는 문제.. 2023. 4. 4.
70] Leetcode 1929. Concatenation of Array int 배열을 두번 써주면 된다. class Solution { fun getConcatenation(nums: IntArray): IntArray { val ans = IntArray(nums.size *2 ) for (i in nums.indices) { ans[i] = nums[i]; ans[i+ nums.size] = nums[i]; } return ans; } } . class Solution { fun getConcatenation(nums: IntArray): IntArray { val size = nums.size val concatenationArray = IntArray(size * 2) for (i in nums.indices) { concatenationArray[i] = nums[.. 2023. 4. 3.
62★★★] 카카오 블라인드 / 메뉴 리뉴얼 /C++ 코딩테스트 연습 - 메뉴 리뉴얼 레스토랑을 운영하던 스카피는 코로나19로 인한 불경기를 극복하고자 메뉴를 새로 구성하려고 고민하고 있습니다. 기존에는 단품으로만 제공하던 메뉴를 조합해서 코스요리 형태로 재구성해서 programmers.co.kr 1. 각 단품메뉴 개수(course)별로 2. 각 손님들이 주문한 단품메뉴 리스트(order)에서 만들 수 있는 조합과 그 조합이 나온 횟수를 구하고, - 조합을 구하는 방법은 0과 1로 이뤄진 벡터(선택할 메뉴개수 = 1의 개수)를 next_permutation돌려서 - 1인 문자열을 map에 넣는 식으로 했습니다. // 설명하기도 힘든 어려븐 문제 3. 횟수로 정렬해서 4. 최대값인 문자열만 answer에 넣습니다. #include #include #inclu.. 2021. 8. 28.