[LeetCode] Shortest Subarray to be Removed to Make Array Sorted

1574. Shortest Subarray to be Removed to Make Array Sorted

Given an integer array arr, remove a subarray (can be empty) from arr such that the remaining elements in arr are non-decreasing.

A subarray is a contiguous subsequence of the array.

Return the length of the shortest subarray to remove.

Read more
[LeetCode] Minimum Operations to Reduce X to Zero

1658. Minimum Operations to Reduce X to Zero

You are given an integer array nums and an integer x. In one operation, you can either remove the leftmost or the rightmost element from the array nums and subtract its value from x. Note that this modifies the array for future operations.

Return the minimum number of operations to reduce x to exactly 0 if it’s possible, otherwise, return -1.

Read more
[LeetCode] Longest Well-Performing Interval

1124. Longest Well-Performing Interval

We are given hours, a list of the number of hours worked per day for a given employee.

A day is considered to be a tiring day if and only if the number of hours worked is (strictly) greater than 8.

A well-performing interval is an interval of days for which the number of tiring days is strictly larger than the number of non-tiring days.

Return the length of the longest well-performing interval.

Read more
[Spring Boot] Mybatis association 태그를 Java Config로 바꾸기

Mybatis 클래스 내에 다른 클래스 맵핑하기

Read more
[Spring Boot] Mybatis Auto Increment 값 받아오기

Mybatis Auto Increment 값 받아오기

Read more
[Spring Boot] 비동기 처리

Spring Boot Async

Read more
[Spring Boot] @Autowired와 @Requiredargconstructor

의존성 주입

Read more
[LeetCode] Sentence Screen Fitting

418. Sentence Screen Fitting

Given a rows x cols screen and a sentence represented by a list of non-empty words, find how many times the given sentence can be fitted on the screen.

Note:

  • A word cannot be split into two lines.
  • The order of words in the sentence must remain unchanged.
  • Two consecutive words in a line must be separated by a single space.
  • Total words in the sentence won’t exceed 100.
  • Length of each word is greater than 0 and won’t exceed 10.
  • 1 ≤ rows, cols ≤ 20,000.
Read more
[LeetCode] Maximum Score from Performing Multiplication Operations

1770. Maximum Score from Performing Multiplication Operations

You are given two integer arrays nums and multipliers of size n and m respectively, where n >= m. The arrays are 1-indexed.

You begin with a score of 0. You want to perform exactly m operations. On the ith operation (1-indexed), you will:

  • Choose one integer x from either the start or the end of the array nums.
  • Add multipliers[i] * x to your score.
  • Remove x from the array nums.

Return the maximum score after performing m operations.

Read more
[LeetCode] Maximize Palindrome Length From Subsequences

1771. Maximize Palindrome Length From Subsequences

You are given two strings, word1 and word2. You want to construct a string in the following manner:

  • Choose some non-empty subsequence subsequence1 from word1.
  • Choose some non-empty subsequence subsequence2 from word2.
  • Concatenate the subsequences: subsequence1 + subsequence2, to make the string.
    Return the length of the longest palindrome that can be constructed in the described manner. If no palindromes can be constructed, return 0.

A subsequence of a string s is a string that can be made by deleting some (possibly none) characters from s without changing the order of the remaining characters.

A palindrome is a string that reads the same forward as well as backward.

Read more