Computer Hippocampus
  • 홈
  • 태그
  • 방명록
  • 메뉴 닫기
  • 글작성
  • 방명록
  • 환경설정
    • 분류 전체보기 (176)
      • Daily Records (0)
      • Coding Test 관련(with Kotlin) (0)
      • Android Dev (87)
        • NowInAndroid (7)
        • NaimanProject (0)
        • Compose (21)
        • Navigation (4)
        • Google Billing API (4)
        • Test Firebase Chatting App (12)
        • Login API 정리 (0)
        • Error logs (0)
      • 코틀린(Kotlin, Java) (14)
      • Swift (12)
        • codingTest (0)
      • Spring Boot (1)
      • Scala (3)
      • Js (0)
      • Programming Theory (13)
        • Functional Programming (2)
        • Design Pattern (0)
        • Generics (3)
        • 비동기 패러다임(Asynchronous Para.. (0)
        • 코루틴(Coruotine) (8)
        • Rxjava (0)
      • 파이어베이스(Firebase) (0)
      • 프로그래밍 팁 (1)
      • SystemVerilog (2)
      • Adobe (4)
        • 포토 일러스트레이터 (4)
        • Premiere pro (0)
      • Github 팁 (3)
      • RiscV (2)
        • Wake (1)
      • Linux (2)
      • CSS (4)
      • 회사 관련 (0)
  • 홈
  • 태그
  • 방명록
코틀린(Kotlin, Java)

Array 순회, for문 만들 때

repeat(wires.size) { val a = wires[it][0] - 1 val b = wires[it][1] - 1 P[a][b] = true P[b][a] = true } 위와 같이 repeat으로 wire.indices를 간단하게 처리할 수 있다.

2022. 2. 27. 01:16
코틀린(Kotlin, Java)

2차원 배열 초기화

가끔 깜빡하고 map을 주로 쓰는 경향이 있는데.. 2차원 배열을 Array 로 만들수 있다는 것을 간과하지 말자. 예는 아래와 같다. val edgeMutableList = Array(n) { Array(n) { 0 } } fares.map { edgeMutableList[it[0]][it[1]] = it[2] edgeMutableList[it[1]][it[0]] = it[2] }

2022. 2. 24. 02:29
코틀린(Kotlin, Java)

Regex trial in kotlin

테스트 사이트 : https://regexr.com/ kotlin regex 참고 페이지 : https://codechacha.com/ko/kotlin-how-to-use-regex/ 코틀린 에서 정규 표현식 사용하기 이 포스트 에서는 정규 표현식의 구문법 또는 작성법을 다루지 않습니다. 그러므로 문서의 이해를 위해서 최소한의 정규 표현식 지식이 필요합니다. medium.com 1. 문자열 찾기 예제 val str = "...!@BaT#*..y.abcdefghijklm" val regex = Regex("""[a-z0-9._-]""") val matchResult = regex.findAll(str) matchResult.forEach { println("match value: ${it.value}") ..

2022. 2. 23. 23:40
코틀린(Kotlin, Java)

나볼려고 만든 다익스트라 예제

구현시 기록할 것은 starting Node와 end Node의 weight table이며

2022. 2. 23. 02:44
코틀린(Kotlin, Java)

kotlin - compartor 예제

fun comp(s: String, b: String): Int { return if(s+b > b+s) -1 else 1 } fun solution(numbers: IntArray): String { val dd = numbers.map { it.toString() }.sortedWith(comparator = Comparator { o1, o2 -> comp(o1, o2)}).fold(""){ acc, str -> acc + str} return dd } }

2022. 2. 22. 19:29
코틀린(Kotlin, Java)

recursive call with tailrec

tailrec fun pathFinder(grid: Array, tNode : GNode, fromWhere : Direction, direction : Direction, pathLengh : Int, setMap : MutableMap) { if(tNode.carvingRecord(fromWhere, direction)){ //available to move on next step //get next node val nextNode = tNode.nextNode(direction) //get next node direction val nextDirection = when(grid[nextNode.first][nextNode.second]){ 's', 'S' -> { when(direction){ Di..

2022. 2. 21. 01:37
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • ···
  • 30
  • »

공지사항

전체 카테고리

  • 분류 전체보기 (176)
    • Daily Records (0)
    • Coding Test 관련(with Kotlin) (0)
    • Android Dev (87)
      • NowInAndroid (7)
      • NaimanProject (0)
      • Compose (21)
      • Navigation (4)
      • Google Billing API (4)
      • Test Firebase Chatting App (12)
      • Login API 정리 (0)
      • Error logs (0)
    • 코틀린(Kotlin, Java) (14)
    • Swift (12)
      • codingTest (0)
    • Spring Boot (1)
    • Scala (3)
    • Js (0)
    • Programming Theory (13)
      • Functional Programming (2)
      • Design Pattern (0)
      • Generics (3)
      • 비동기 패러다임(Asynchronous Para.. (0)
      • 코루틴(Coruotine) (8)
      • Rxjava (0)
    • 파이어베이스(Firebase) (0)
    • 프로그래밍 팁 (1)
    • SystemVerilog (2)
    • Adobe (4)
      • 포토 일러스트레이터 (4)
      • Premiere pro (0)
    • Github 팁 (3)
    • RiscV (2)
      • Wake (1)
    • Linux (2)
    • CSS (4)
    • 회사 관련 (0)
애드센스 광고 영역
  • 최근 글
  • 최근 댓글

최근 글

최근댓글

태그

MORE

전체 방문자

오늘
어제
전체

블로그 인기글

Powered by Privatenote Copyright © Computer Hippocampus All rights reserved. TistoryWhaleSkin3.4

티스토리툴바