본문 바로가기

Java56

자바 MessageFormat C#의 String.Format과 유사한 클래스 함수 Java MessageFormat.format("[{0}]{1}", "0 입력 문자열", "1 입력 문자열"); public static String format(String pattern, Object ... arguments) { MessageFormat temp = new MessageFormat(pattern); return temp.format(arguments); } C# String s = String.Format("The current price is {0} per ounce.", pricePerOunce); 2022. 5. 20.
자바 비밀번호 생성(금융보안원) import java.util.ArrayList; import java.util.List; public class PasswordValidation { //220510 nhm, public static boolean isPasswordInvalid(String password, String email, String birth, String cellNo, int characterCheckCount) { //비밀번호 길이 if(!isPasswordRange(password)) { return false; } //알파벳 대문자와 소문자, 숫자, 특수문자 중 두 종류 이상 포함 if(!isContainsPasswordType(password)) { return false; } //계정명· 고유식별번호·생년월일·.. 2022. 5. 10.
자바 프로그래머스 위클리 챌린지 8주차 최소직사각형 구하기. https://programmers.co.kr/learn/courses/30/lessons/86491 코딩테스트 연습 - 8주차 [[10, 7], [12, 3], [8, 15], [14, 7], [5, 15]] 120 [[14, 4], [19, 6], [6, 16], [18, 7], [7, 11]] 133 programmers.co.kr public int solution(int[][] sizes) { int maxWidth = 0; int maxHeight = 0; int width; int height; final int widthIndex = 0; final int heightIndex = 1; for(int[] size : sizes) { width = size[widthIn.. 2021. 10. 1.
자바 임의 값 0~100 랭크 구하기 거의 1년만에 OKKY 사이트에 들어가봤더니 이런 링크가 있었다. https://okky.kr/article/1052166 OKKY | 이 문제 어떻게 푸는게 맞는걸까요? (손코딩 간단한 문제) 오늘 경력직 면접 손코딩 시험 보면서 나온 문제 중 하나인데 솔직히 코딩테스트 봐본게 4년 전이고.. 기억도 안나구.. 일했던게 IT기업도 아니구.. 그래서 그냥 풀이 자체만 신경썼는데 어떤 메 okky.kr 그래서... 그냥 한 40분정도 나라면 어떻게 만들까 하다가 생각해봤다. 그러다 고민되는 룰이 하나 생김. Sql에도 존재하듯 동일한 점수면 어떻게 할 것인가? 대충 100점이 2명일 때 99점이면 이건 3등으로 처리하자라고 생각함. private static final ArrayList rankArrayL.. 2021. 9. 16.