Kotlin
-
Exercism - Space Age (With.Kotlin)문제풀이/Exercism 2019. 7. 26. 14:08
[문제] Given an age in seconds, calculate how old someone would be on: Earth: orbital period 365.25 Earth days, or 31557600 seconds Mercury: orbital period 0.2408467 Earth years Venus: orbital period 0.61519726 Earth years Mars: orbital period 1.8808158 Earth years Jupiter: orbital period 11.862615 Earth years Saturn: orbital period 29.447498 Earth years Uranus: orbital period 84.016846 Earth year..
-
Exercism - Gigasecond(With.Kotlin)문제풀이/Exercism 2019. 7. 23. 14:29
[문제] Given a moment, determine the moment that would be after a gigasecond has passed. A gigasecond is 10^9 (1,000,000,000) seconds. [Solution1] import java.time.LocalDate import java.time.LocalDateTime import java.time.LocalTime import java.time.temporal.ChronoUnit class Gigasecond { private val gigaSeconds = 1_000_000_000L val date: LocalDateTime constructor(localDate: LocalDate){ date = Local..
-
Exercism - Leap(With.Kotlin)문제풀이/Exercism 2019. 7. 22. 12:24
[문제] Given a year, report if it is a leap year. The tricky thing here is that a leap year in the Gregorian calendar occurs: on every year that is evenly divisible by 4 except every year that is evenly divisible by 100 unless the year is also evenly divisible by 400 For example, 1997 is not a leap year, but 1996 is. 1900 is not a leap year, but 2000 is. Notes Though our exercise adopts some very ..
-
Exercism - Hamming(With.Kotlin)문제풀이/Exercism 2019. 7. 21. 10:07
[문제] Calculate the Hamming Distance between two DNA strands. Your body is made up of cells that contain DNA. Those cells regularly wear out and need replacing, which they achieve by dividing into daughter cells. In fact, the average human body experiences about 10 quadrillion cell divisions in a lifetime! When cells divide, their DNA replicates too. Sometimes during this process mistakes happen ..
-
Exercism - RNA Transcription(With.Kotlin)문제풀이/Exercism 2019. 7. 16. 22:33
[문제] Given a DNA strand, return its RNA complement (per RNA transcription). Both DNA and RNA strands are a sequence of nucleotides. The four nucleotides found in DNA are adenine (A), cytosine (C), guanine (G) and thymine (T). The four nucleotides found in RNA are adenine (A), cytosine (C), guanine (G) and uracil (U). Given a DNA strand, its transcribed RNA strand is formed by replacing each nucl..
-
Exercism - Twofer (with.Kotlin)문제풀이/Exercism 2019. 7. 16. 00:41
[문제] Two-fer or 2-fer is short for two for one. One for you and one for me. Given a name, return a string with the message: One for X, one for me. Where X is the given name. However, if the name is missing, return the string: One for you, one for me. Here are some examples: NameString to return Alice One for Alice, one for me. Bob One for Bob, one for me. One for you, one for me. Zaphod One for ..
-
Koin Sample Test codeAndroid 2019. 7. 14. 10:17
https://github.com/DNights/KoinSampleTest DNights/KoinSampleTest Contribute to DNights/KoinSampleTest development by creating an account on GitHub. github.com Koin Sample code 입니다. 아직 실무에 써본적이 없어서 Sample 로 만들어 보면서 공부중입니다. DI를 써보면서 개념도 같이 공부중입니다. 차후 정리하면서 올릴 예정입니다. [참고 내역] https://insert-koin.io/ insert-koin.io a smart Kotlin dependency injection framework insert-koin.io https://github.com/Agusta..
-
구름Level - 시험성적 평균과 등급구하기문제풀이/Goorm Level 2019. 7. 9. 09:32
구름 Level 이라는 서비스를 이용해서 문제풀이를 해보고 있습니다. https://level.goorm.io/ 구름LEVEL 난이도별 다양한 문제를 해결함으로써 SW 역량을 향상시킬 수 있습니다. level.goorm.io 문제의 내용은 위 링크에서 "시험성적 평균과 등급구하기"로 검색하여 확인하시기 바랍니다. 제출 코드 (Kotlin) import java.util.Scanner fun main(args: Array) { val input = readLine() print(testOutput(input.toString())) } fun testOutput(input: String) : String{ val 성적 = input.split(" ") if(성적[0].toInt() < 0 || 성적[0].t..
-
구름Level - Hello Goorm ! 문제풀이문제풀이/Goorm Level 2019. 7. 4. 15:17
구름 Level 이라는 서비스를 이용해서 문제풀이를 해보고 있습니다. https://level.goorm.io/ 구름LEVEL 난이도별 다양한 문제를 해결함으로써 SW역량을 향상시킬 수 있습니다. level.goorm.io 문제의 내용은 위 링크에서 Hello Goorm ! 검색하여 확인하시기 바랍니다. 제출 코드 (Kotlin) import java.util.Scanner fun main(args: Array) { val input = readLine() test(input.toString()) } fun test(input: String){ val num = input.toInt() for(i in 1..num){ println("Hello Goorm !") } } 간단하게 입력수 만큼 Hello G..