본문 바로가기

전체 글234

[LeetCode][Kotlin] 907. Sum of Subarray Minimums 907. Sum of Subarray MinimumsGiven an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo 10^9 + 7.정수 arr의 배열이 주어졌을 때, b가 arr의 모든 (인접한) 부분 배열에 걸쳐 있는 min(b)의 합을 구하세요. 답이 클 수 있으므로 답을 10^9 + 7로 나눈 나머지로 반환합니다. Example 1:Input: arr = [3,1,2,4]Output: 17Explanation: Subarrays are [3], [1], [2], [.. 2024. 12. 3.
[LeetCode][Kotlin] 456. 132 Pattern 456. 132 PatternGiven an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i  Return true if there is a 132 pattern in nums, otherwise, return false.n개의 정수 nums의 배열이 주어지면 132 패턴은 i nums에 132 패턴이 있으면 true를 반환하고, 그렇지 않으면 false를 반환합니다. Example 1:Input: nums = [1,2,3,4]Output: falseExplanation: There is no 132 pattern in the sequence. E.. 2024. 12. 3.
[LeetCode][Kotlin] 1209. Remove All Adjacent Duplicates in String II 1209. Remove All Adjacent Duplicates in String IIYou are given a string s and an integer k, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them, causing the left and the right side of the deleted substring to concatenate together. We repeatedly make k duplicate removals on s until we no longer can. Return the final string after all such duplicate remo.. 2024. 12. 2.
[LeetCode][Kotlin] 402. Remove K Digits 402. Remove K DigitsGiven string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num.음이 아닌 정수 num을 나타내는 문자열 num과 정수 k가 주어지면, num에서 k자리를 제거한 후 가능한 가장 작은 정수를 반환합니다. Example 1:Input: num = "1432219", k = 3Output: "1219"Explanation: Remove the three digits 4, 3, and 2 to form the new number 1219 which is the smallest. E.. 2024. 12. 2.
[Kotlin][Collection] subList 지정된 fromIndex(포함)와 toIndex(제외) 사이의 이 목록 부분에 대한 뷰를 반환합니다. 반환된 목록은 이 목록에 의해 백업되므로 반환된 목록의 비구조적 변경 사항은 이 목록에 반영되고 그 반대의 경우도 마찬가지입니다. 기본 목록의 구조적 변경 사항은 뷰의 동작을 정의되지 않게 만듭니다.public actual fun subList(fromIndex: Int, toIndex: Int): Listval numbers = mutableListOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)val subList = numbers.subList(2, 6)println(numbers) // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]println(subList) // [3,.. 2024. 12. 2.
The following options were not recognized by any processor: '[dagger.fastInit, dagger.hilt.android.internal.disableAndroidSuperclassValidation, dagger.hilt.android.internal.projectType, dagger.hilt.internal.useAggregatingRootProcessor, kapt.kotlin.generat [ 해결 ]// build.gradle.kts (Module-level)id("kotlin-kapt") [ 참고 ]https://stackoverflow.com/questions/70550883/warning-the-following-options-were-not-recognized-by-any-processor-dagger-f warning : The following options were not recognized by any processor: '[dagger.fastInit, kapt.kotlin.generated]'I get this warning when I try to run or build an app in Android Studio. Why am I getting this? Do I n.. 2024. 11. 30.
This version (1.5.1) of the Compose Compiler requires Kotlin version 1.9.0 but you appear to be using Kotlin version 1.9.23 which is not known to be compatible. [ 해결 ]composeOptions { kotlinCompilerExtensionVersion = "1.5.12"}Compose 컴파일러 버전호환되는 Kotlin 버전Compose Compiler Gradle 플러그인을 사용하여 Compose를 사용 설정합니다.2.0.0 이상1.5.141.9.241.5.131.9.231.5.121.9.231.5.111.9.231.5.101.9.221.5.9달러1.9.221.5.81.9.221.5.72021년 1월 9일1.5.62021년 1월 9일1.5.51.9.21.5.41.9.21.5.31.9.11.5.21.9.01.5.11.9.01.5.01.9.01.4.82022년 1월 8일1.4.72021년 1월 8일1.4.61,8201.4.51,8201.4.41.8.101.. 2024. 11. 30.