✨ 문제 Delete Greatest Value in Each RowYou are given an m x n matrix grid consisting of positive integers.Perform the following operation until grid becomes empty:Delete the element with the greatest value from each row. If multiple such elements exist, delete any of them. Add the maximum of deleted elements to the answer.Note that the number of columns decreases by one after each operation.Retur..
전체 글
개발 공부하는 블로그✨ 문제 Baseball GamesYou are keeping the scores for a baseball game with strange rules. At the beginning of the game, you start with an empty record.You are given a list of strings operations, where operations[i] is the ith operation you must apply to the record and is one of the following:An integer x.Record a new score of x.'+'Record a new score that is the sum of the previous two scores.'D'Reco..
✨ 아키텍처 흐름🔔 배포 흐름코드 수정 후 깃허브에 push하면 Github Actions 트리거가 동작하여 빌드 및 DockerFile, deploy.sh, application.yaml 등을 포함하여 zip 파일을 생성한다.생성된 zip파일은 S3에 업로드되고 CodeDeploy에 배포 요청을 보내면 S3에 업로드 된 zip파일을 EC2에 배포한다. EC2 인스턴스에서 DockerFile을 통해 이미지가 만들어지고 Docker 컨테이너에 애플리케이션과 Redis가 띄워진다.Spring Boot 애플리케이션과 Redis는 동일한 Docker 네트워크에 연결되어 실행된다. 우리 서비스는 처음에는 MVC로 구현되었다가 Rest API로 리팩토링을 하였는데 모든 도메인이 리팩토링이 되지 않았기 때문에 m..
✨ 문제 Final Prices With a Special Discount in a ShopYou are given an integer array prices where prices[i] is the price of the ith item in a shop. There is a special discount for items in the shop. If you buy the ith item, then you will receive a discount equivalent to prices[j] where j is the minimum index such that j > i and prices[j] . Otherwise, you will not receive any discount at all . Retur..
✨ 문제 Number of Recent CallsYou have a RecentCounter class which counts the number of recent requests within a certain time frame.Implement the RecentCounter class:RecentCounter() Initializes the counter with zero recent requests. int ping(int t) Adds a new request at time t, where t represents some time in milliseconds, and returns the number of requests that has happened in the past 3000 millis..
✨ 문제 Number of Students Unable to Eat LunchThe school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular sandwiches.The number of sandwiches in the cafeteria is equal to the number of students. The sandwiches are placed in a stack. At each step:If the student at..
✨ 문제 Find Targer Indices After Sorting ArrayYou are given a 0-indexed integer array nums and a target element target.A target index is an index i such that nums[i] == target.Return a list of the target indices of nums after sorting nums in non-decreasing order. If there are no target indices, return an empty list. The returned list must be sorted in increasing order. https://leetcode.com/problem..
✨ 문제 Neither Minimum nor MaximumGiven an integer array nums containing distinct positive integers, find and return any number from the array that is neither the minimum nor the maximum value in the array, or -1 if there is no such number. Return the selected integer. https://leetcode.com/problems/neither-minimum-nor-maximum/description/ ✨ 최종코드class Solution { public int findNonMinOrMax(int..
✨ 문제 Decode the MessageYou are given the strings key and message, which represent a cipher key and a secret message, respectively. The steps to decode message are as follows:Use the first appearance of all 26 lowercase English letters in key as the order of the substitution table.Align the substitution table with the regular English alphabet.Each letter in message is then substituted using the t..
✨ 문제 Shuffle StringYou are given a string s and an integer array indices of the same length.The string s will be shuffled such that the character at the ith position moves to indices[i] in the shuffled string. Return the shuffled string. https://leetcode.com/problems/shuffle-string/description/ ✨ 최종코드class Solution { public String restoreString(String s, int[] indices) { char[] answe..