[Hacker Rank] Cats and a Mouse (Kotlin)
λ¬Έμ νμ 1κ°μ μ§μ μ’ν μμ κ³ μμ΄ 2λ§λ¦¬, μ₯ 1λ§λ¦¬κ° μμΉ Cat A, Cat B μ€ Mouseμ λ κ°κΉμ΄ μμΉμ μλ κ³ μμ΄λ₯Ό Print νμ κΈ°ν 쑰건 Cat A, Cat B μ Mouseμ κ±°λ¦¬κ° λͺ¨λ λμΌν κ²½μ° Mouseλ₯Ό Print νμ νμ΄- Kotlin fun catAndMouse(x: Int, y: Int, z: Int): String { val a = Math.abs(x - z) val b = Math.abs(y - z) return if (a b) { "Cat B" } else { "Mouse" } } λμ³€λ λΆλΆ μ²μμ κΈνκ² λ Όλ¦¬λ§ μΈμλ μ±λ‘ μ§ννμ λ Failμ΄ λμ μ€λ§νλ€. λ€μ μ°¬μ°¬νκ² μ΄ν΄λ³΄λ κ° κ³ μμ΄λ€..
ππππππ/Algorithm
2022. 8. 1. 20:40
곡μ§μ¬ν
μ΅κ·Όμ μ¬λΌμ¨ κΈ
μ΅κ·Όμ λ¬λ¦° λκΈ
- Total
- Today
- Yesterday
λ§ν¬
TAG
- GitHub
- DexArchiveBuilderException
- Hilt
- custom setter
- How to import android AAR file
- Kotlin
- module-info is missing a super type
- android aar
- android databinding
- custom getter
- viewmodel
- android launch mode in manifest
- com.android.build.api.transform.TransformException
- databinding onClick
- Make onClick event in Android databinding
- databinding onclick not working
- import aar
- Please use a personal access token instead
- Effective Kotlin
- The requested URL returned error
- launchemode
- Support for password authentication was removed on August 13
- aar import
- android
- AndroidManifest
- AAR
- android aar library
- Cannot create an instance
- decomplie
- annotaion
μΌ | μ | ν | μ | λͺ© | κΈ | ν |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
κΈ λ³΄κ΄ν¨