본문 바로가기

문자열7

코딩테스트 입문 - Day 21 숨어있는 숫자의 덧셈 (2)class Solution { public int solution(String my_string) { StringBuilder sb = new StringBuilder(); int answer = 0; for(int i =0;i안전지대class Solution { int answer = 0; int [] di = {-1,-1,-1,0,1,1,1,0}; int [] dj = {-1,0,1,-1,-1,0,1,1}; public int solution(int[][] board) { for(int i = 0; i = 0 && pi = 0 && pj 삼각형의 완성 조건 (2)class Solution { .. 2025. 5. 5.
코딩테스트 입문 - Day 15 영어가 싫어요class Solution { public long solution(String numbers) { return Long.parseLong(numbers.replace("zero","0") .replace("one","1") .replace("two","2") .replace("three","3") .replace("four","4") .replace("five","5") .replace("six","6") .replace("seven","7") .replace("eight","8") .replace.. 2025. 4. 27.
프로그래머스 - 특수문자 출력하기 문제 설명다음과 같이 출력하도록 코드를 작성해 주세요.출력 예시!@#$%^&*(\\'"?:;코드import java.util.Scanner;public class Solution { public static void main(String[] args) { System.out.print("!@#$%^&*(\\\\'\\"?:;"); }} 2025. 4. 12.
코딩테스트 입문 - Day 7 특정 문자 제거하기class Solution { public String solution(String my_string, String letter) { return my_string.replace(letter,""); }}각도기class Solution { public int solution(int angle) { if(angle 양꼬치class Solution { public int solution(int n, int k) { return n*12000 + k*2000 - n/10*2000; }}짝수의 합class Solution { public int solution(int n) { n = n - n%2; .. 2025. 4. 12.
코딩테스트 입문 - Day 6 뒤집힌 문자열class Solution { public String solution(String my_string) { StringBuilder sb = new StringBuilder(); for(int i = my_string.length() - 1; i >= 0; i--){ sb.append(my_string.charAt(i)); } return sb.toString(); }}직각삼각형 출력하기import java.util.Scanner;public class Solution { public static void main(String[] args) { Scanner sc = new Sca.. 2025. 4. 12.
리트 코드 - 1768. Merge Strings Alternately 1768. Merge Strings AlternatelySolvedEasyTopicsCompaniesHintYou are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.Return the merged string.Example 1:Input: word1 = "abc", word2 = "pqr"Output: "apbqcr"Explanation: The merged stri.. 2025. 4. 5.
728x90
반응형