- Today
- Total
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 코틀린
- 책리뷰
- CustomTab
- jlpt
- GIT
- 안드로이드
- rxjava
- ai
- blog
- coroutine
- webflux
- KotlinInAction
- suspend
- errorhandling
- 일본어기초
- androidstudio
- Kotlin
- 책추천
- 학습지
- github
- 진짜학습지
- 인공지능
- 진짜일본어
- 진짜학습지후기
- n3문법
- PR
- pullrequest
- posting
- 일본어문법
- Android
목록알고리즘/HackerRank (3)
코딩하는 개굴이

큰 숫자의 팩토리얼도 계산할 수 있는지를 묻는 문제이자, BigInteger 를 사용하는 법에 대해 알려주는 문제이다. int 형의 메모리 크기는 4byte 로 표현이 가능한 범위는 -2,147,483,648 ~ 2,147,483,647이고 long은 메모리 크기는 8byte로 표현할 수 있는 범위는 -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807이다. 해당 범위가 넘어가는 경우가 존재한다면 오작동의 가능성이 존재한다. 따라서, 알고리즘을 풀 때, 무한의 정수가 들어가거나 큰 숫자가 들어갈 가능성이 있는 경우는 BigInteger를 사용하는 것을 권장한다. 본래 JAVA 에서는 BigInteger 가 문자열의 형태로 이루어져있어 어떠한 숫자든 담을 수 있..

Compare Triplets : https://www.hackerrank.com/challenges/compare-the-triplets/problem Compare the Triplets | HackerRank Compare the elements in two triplets. www.hackerrank.com 간단한 문제이다. fun compareTriplets(a: Array, b: Array): Array { // Write your code here var aScore = 0 var bScore = 0 for(i in a.indices) { if(a[i] b[i]) aScore++ } val arr = Array(2) { 0 } arr[..

Super Reduced String : https://www.hackerrank.com/challenges/reduced-string/problem Super Reduced String | HackerRank Given a string, repeatedly remove adjacent pairs of matching characters and then print the reduced result. www.hackerrank.com 2개 이상 중복되는 캐릭터가 있으면 삭제하는 문제이다. 재귀로 반복적인 확인을 수행하면 해결할 수 있다. fun superReducedString(s: String): String { // Write your code here for (i in s.indices) { if (..