본문 바로가기

IT/알고리즘87

81 프로그머스] Kotlin 대소문자 바꿔서 출력하기 fun main(args: Array) { val s1 = readLine()!! var ans = "" for(i in 0 until s1.length) { if(Character.isUpperCase(s1[i])) { ans += Character.toLowerCase(s1[i]); } else { ans += Character.toUpperCase(s1[i]); } } println(ans) } https://notepad96.tistory.com/89 Kotlin UpperCase & LowerCase - 대소문자 검사 및 변환 1. UpperCase, LowerCase 문자열을 대문자 혹은 소문자로 변환하거나 현재 대문자인지 소문자인지 검사하고 싶을 경우가 있다. 무언가를 판별하는 함수 앞에는 .. 2023. 10. 8.
80] 프로그래머스 문자열 반복해서 출력하기 fun main(args: Array) { val input = readLine()!!.split(' ') val s1 = input[0] val a = input[1]!!.toInt() for(i in 0 until a){ print(s1) } } https://postiveemblem.tistory.com/164 [Kotlin][5]코틀린 readline()과 자료형 변환 방법 안녕하세요. 오늘은 저번 타이머 함수 사용법에 이어서 readline()을 이용해 사용자에게 입력받는 법을 알아보려고 합니다. 또 입력 받은 모든 값을 스트링 값으로 반환하는 readline()을 어떻게 하면 postiveemblem.tistory.com 2023. 10. 8.
79] 프로그래머스 a와 b 출력하기 kotlin fun main(args: Array) { val (a, b) = readLine()!!.split(' ').map(String::toInt) println("a = $a") println("b = $b") } https://postiveemblem.tistory.com/164 [Kotlin][5]코틀린 readline()과 자료형 변환 방법 안녕하세요. 오늘은 저번 타이머 함수 사용법에 이어서 readline()을 이용해 사용자에게 입력받는 법을 알아보려고 합니다. 또 입력 받은 모든 값을 스트링 값으로 반환하는 readline()을 어떻게 하면 postiveemblem.tistory.com 2023. 10. 5.
78] 1672. Richest Customer Wealth Kotlin https://leetcode.com/problems/richest-customer-wealth/description/ Richest Customer Wealth - LeetCode Can you solve this real interview question? Richest Customer Wealth - You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i th customer has in the j th bank. Return the wealth that the richest customer has. A custom leetcode.com 2차원 int 배열이 주어질때 각 행의 합 중 .. 2023. 4. 19.