개발공부

    [Kotlin] LeetCode - Best Time to Buy and Sell Stock IISolution - 풀이과정

    [Kotlin] LeetCode - Best Time to Buy and Sell Stock IISolution - 풀이과정

    문제 You are given an array prices where prices[i] is the price of a given stock on the ith day. Find the maximum profit you can achieve. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times). Note: You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again). 그날의 stock 가격이 prices라는 array에..

    [Kotlin] String, Int 순서 뒤집기 - LeetCode: Reverse Integer 풀이

    [Kotlin] String, Int 순서 뒤집기 - LeetCode: Reverse Integer 풀이

    문제 Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned). 예시 x를 넣으면 reversed된 값을 반환하게 만들어야합니다. 풀이 1. String으로 변환후 순서 뒤집기 저는 integer을 string으로 바꿔서 char 하나씩 접근하여 보내려했는데 //오답 fun reverse(x:..

    [Kotlin] LeetCode 1. Two Sum 풀이 - for index, indices 활용

    [Kotlin] LeetCode 1. Two Sum 풀이 - for index, indices 활용

    문제 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. 예시 위와같이 nums와 target이 fun twoSum에 들어가서 반환값이 0,1이 나와야하게 만들어야합니다. 0,1은 nums의 index(위치) 값이고 둘의 합은 9가 되어야합니다. 둘의 합이 9가되는 두 숫자의 in..

    [Kotlin] Google AdMob 앱 수익창출 -  광고 달기 배너달기 / 버튼클릭시 전면광고

    [Kotlin] Google AdMob 앱 수익창출 - 광고 달기 배너달기 / 버튼클릭시 전면광고

    [Kotlin] Google AdMob 앱 수익창출 - 광고 달기 / 배너달기/ 버튼클릭시 전면광고 목표 전면광고 / 배너 광고 구글 AdMob에서 광고 단위 설정 구글 AdMob을 가입해줍니다. 홈으로 들어오면 구글AdMob 페이지에서 광고를 설정할 앱을 추가해줍니다. 플랫폼과 PlayStore에 등록 여부를 선택해줍니다. 앱 이름을 설정해준 후 확인. 바로 광고 단위를 만들어보겠습니다. 배너 추가하기 저는 activity_main 하단에 배너를 추가해 보도록 하겠습니다. 식별 가능하도록 광고에 이름을 붙여준 후 1번: 앱 ID 2번: 광고 단위 ID 코드를 기억해둡니다. 이제 이 두 ID를 만든 앱에 적용하겠습니다. 테스트 할 때는 "2번 ID"는 구글에서 제공하는 테스트 아이디를 써주세요 배너용 t..