전체 글에 해당하는 글 293

  1. [LeetCode] Move Zeroes 2024.09.20

    https://leetcode.com/problems/move-zeroes/description/?envType=study-plan-v2&envId=leetcode-75 Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.Note that you must do this in-place without making a copy of the array. Example 1:Input: nums = [0,1,0,3,12]Output: [1,3,12,0,0]Example 2:Input: nums = [0]Output: [0] Constraints:1 -..


  2. [LeetCode] String Compression 2024.09.20

    https://leetcode.com/problems/string-compression/description/?envType=study-plan-v2&envId=leetcode-75 Given an array of characters chars, compress it using the following algorithm:Begin with an empty string s. For each group of consecutive repeating characters in chars:If the group's length is 1, append the character to s.Otherwise, append the character followed by the group's length.The compres..


  3. [LeetCode] Increasing Triplet Subsequence 2024.09.19

    https://leetcode.com/problems/increasing-triplet-subsequence/description/?envType=study-plan-v2&envId=leetcode-75 Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i  and nums[i]  Example 1:Input: nums = [1,2,3,4,5]Output: trueExplanation: Any triplet where i Example 2:Input: nums = [5,4,3,2,1]Output: falseExplanation: No triplet exists.Example 3:In..


  4. [LeetCode] Reverse ... a String 2024.09.17

    비슷한 두 개의 문제를 풀었다. 첫 번째 문제 (Reverse Vowels of a String)https://leetcode.com/problems/reverse-vowels-of-a-string/description/?envType=study-plan-v2&envId=leetcode-75Given a string s, reverse only all the vowels in the string and return it.The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once. Example 1:Input: s = "IceCreAm"Output: "AceCreIm"E..


  5. [LeetCode] Can Place Flowers 2024.09.16

    https://leetcode.com/problems/can-place-flowers/description/?envType=study-plan-v2&envId=leetcode-75 You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return true if n new flowers can be plante..


  6. [LeetCode] Kids With the Greatest Number of Candies 2024.09.16

    https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/description/?envType=study-plan-v2&envId=leetcode-75 There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer extraCandies, denoting the number of extra candies that you have.Return a boolean array result of length n, where re..


  7. [LeetCode] Greatest Common Divisor of Strings 2024.09.15

    https://leetcode.com/problems/greatest-common-divisor-of-strings/?envType=study-plan-v2&envId=leetcode-75 문제 설명For two string s and t, we say "t divides s" if and only if s = t + t + t + ... + t + t (i.e., t is concatenated with itself one or more times). Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2. Example 1:Input: str1 = "ABCABC", str2 = ..


  8. 프로파일별로 다른 파일이 실행되도록 세팅하기 2024.08.02

    백엔드를 만들 때, 프로파일을 나눠 빌드시 설정한 프로파일에 따라 기능을 제한해야 하는 경우가 있다.예를 들어, 어떤 편의 기능은 좀 더 상위 프로파일에서만 지원되게 한다던가,같은 메서드를 사용해도 프로파일에 따라 로직이 달라지는 경우가 있을 수 있다. 이런 부분을 구현하기에 앞서 먼저 기본적인 테스트를 해 봤다.어떤 Service에 대한 인터페이스를 두고 각 프로파일별로 구현한 다음,설정된 프로파일에 따라 각 구현된 Service 내의 메서드가 실행되도록 하려 한다. 우선 폴더 구조는 아래와 같이 설정했다.core에 구현할 서비스의 Test 인터페이스를 생성하고, 프로파일의 이름으로 된 디렉토리 내에서 구현할 예정이다.  package com.example.demo.core;public interfac..


  9. Execution failed for task ':compileJava'. 2024.07.29

    Execution failed for task ':compileJava'.> Could not resolve all files for configuration ':compileClasspath'. > Could not find org.mybatis.spring.boot:mybatis-spring-boot-starter:. Required by: project :Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html build.gradle이나 pom.xml..


  10. [SpringBoot] *.properties 내 값 enum 클래스로 받아 관리하기 2024.07.26

    지금까지는 서버가 작동되는 환경에 대한 상수를 단순히 String으로만 관리해 왔다.플랫폼 서버 개선을 진행하면서 properties로 해당 환경변수를 받고,또 해당 상수를 서버 내부에 enum으로 관리하여 사용할 수 있는 값을 한정하도록 설정했다. 1. enum 클래스 생성package kr.doodoo.common;public enum ServerMode { WINDOW("WINDOW"), MAC("MAC"), ETC("ETC"); private String mode; ServerMode(String mode) { this.mode = mode; } public String getMode() { return this.mode; } ..