본문 바로가기

분류 전체보기414

[LeetCode] 135. Candy 문제 URL : https://leetcode.com/problems/candy/description/ Candy - LeetCode Can you solve this real interview question? Candy - There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candies to these children subjected to the following requirements: * Each leetcode.com 문제 접근법 : 아이들에게 사탕을나눠주는 문제입니다. 모든아이들은 최소 1개이상은 받아야하고 아이.. 2023. 8. 26.
[LeetCode] 115. Distinct Subsequences 문제 URL : https://leetcode.com/problems/distinct-subsequences/description/ Distinct Subsequences - LeetCode Can you solve this real interview question? Distinct Subsequences - Given two strings s and t, return the number of distinct subsequences of s which equals t. The test cases are generated so that the answer fits on a 32-bit signed integer. Example 1: In leetcode.com 문제 접근법 : s의 부분 문자열중에서 t가.. 2023. 8. 26.
프로그래머스 과제 진행하기 문제 URL : https://school.programmers.co.kr/learn/courses/30/lessons/176962 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 문제접근법 : 단순 구현문제인데 그 구현을 어떻게 하냐에 달려있습니다. 시간이 짧기때문에 배열로 장황해서 2000까지 주면서 풀수도 있고 빠르게 풀고싶다면 현재 시간과 다음시간의 텀이 얼마인지 확인한후 그텀의 시간만으로 못미룬 과제까지 해결할수 있다면 해결하고 해결하지못한다면 계속미루는겁니다. 핵심은 멈춰둔 과제가 여러 개일 경우, 가장 최근에 멈춘 과제부터 시작합니다. 이거 보.. 2023. 7. 25.
암호처리 PasswordEncoder Spring Security에서는 비밀번호를 안전하게 저장할 수 있도록 비밀번호의 단방향 암호화를 지원하는 PasswordEncoder 인터페이스와 구현체들을 제공합니다. 이 인터페이스는 아래와 같이 심플하게 구성되어 있습니다. public interface PasswordEncoder { // 비밀번호를 단방향 암호화 String encode(CharSequence rawPassword); // 암호화되지 않은 비밀번호(raw-)와 암호화된 비밀번호(encoded-)가 일치하는지 비교 boolean matches(CharSequence rawPassword, String encodedPassword); // 암호화된 비밀번호를 다시 암호화하고자 할 경우 true를 retur.. 2023. 7. 2.