본문 바로가기

IT/알고리즘93

프로그래머스] 타켓 넘버 Kotlin https://school.programmers.co.kr/learn/courses/30/lessons/43165 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr class Solution { fun solution(numbers: IntArray, target: Int): Int { var answer = 0 fun dfs(size : Int, res: Int) { if(size == numbers.size) { // 끝까지 연산했을때 target과 같으면 answer++ if(res == ta.. 2025. 5. 28.
프로그래머스] JadenCase 문자열 만들기 Kotlin class Solution { fun solution(s: String): String { val answer = s.toMutableList() for(i in answer.indices) { // 다 소문자로 만들고 if(answer[i].isUpperCase()) { answer[i] = answer[i].toLowerCase() } // 조건 맞는거만 대문자로 변환 if(i == 0 && answer[i].isLowerCase()) { answer[i] = answer[i.. 2025. 5. 23.
프로그래머스] 의상 Kotlin https://school.programmers.co.kr/learn/courses/30/lessons/42578?language=kotlin 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr https://seedpotato.tistory.com/329 [프로그래머스] - 의상(Kotlin)https://school.programmers.co.kr/learn/courses/30/lessons/42578 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는seedpotato.tistory.com class Solution { .. 2025. 5. 23.
leetCode] Contains Duplicate / Kotlin https://leetcode.com/explore/featured/card/top-interview-questions-easy/92/array/578/   Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.  class Solution { fun containsDuplicate(nums: IntArray): Boolean { // nums에서 중복제거 된 배열을 정의하고 var distinctArr = nums.distinct() // 배열.. 2024. 12. 17.