전체 글
2037. Minimum Number of Moves to Seat Everyone
https://leetcode.com/problems/minimum-number-of-moves-to-seat-everyone/ Minimum Number of Moves to Seat Everyone - LeetCode Can you solve this real interview question? Minimum Number of Moves to Seat Everyone - There are n seats and n students in a room. You are given an array seats of length n, where seats[i] is the position of the ith seat. You are also given the array studen leetcode.com 모두의 ..
1859. Sorting the Sentence
https://leetcode.com/problems/sorting-the-sentence/ 문장은 선행 또는 후행 공백 없이 하나의 공백으로 구분된 단어 목록입니다. 각 단어는 영문 소문자와 대문자로 구성됩니다. 각 단어에 인덱스가 1인 단어 위치를 추가한 다음 문장의 단어를 재정렬하여 문장을 섞을 수 있습니다. 예를 들어 "This is a sentence"라는 문장은 "sentence4 a3 is2 This1" 또는 "is2 sentence4 This1 a3"로 섞일 수 있습니다. 9개 이하의 단어를 포함하는 섞인 문장 s가 주어지면 원래 문장을 재구성하고 반환합니다. 구현 class Solution { public String sortSentence(String s) { String[] arr =..
2160. Minimum Sum of Four Digit Number After Splitting Digits
https://leetcode.com/problems/minimum-sum-of-four-digit-number-after-splitting-digits/ Minimum Sum of Four Digit Number After Splitting Digits - LeetCode Can you solve this real interview question? Minimum Sum of Four Digit Number After Splitting Digits - You are given a positive integer num consisting of exactly four digits. Split num into two new integers new1 and new2 by using the digits foun..
2413. Smallest Even Multiple
https://leetcode.com/problems/smallest-even-multiple/ Smallest Even Multiple - LeetCode Can you solve this real interview question? Smallest Even Multiple - Given a positive integer n, return the smallest positive integer that is a multiple of both 2 and n. Example 1: Input: n = 5 Output: 10 Explanation: The smallest multiple of both 5 and leetcode.com Given a positive integer n, return the smal..
2469. Convert the Temperature
온도 단위 변환하기 https://leetcode.com/problems/convert-the-temperature/ Convert the Temperature - LeetCode Can you solve this real interview question? Convert the Temperature - You are given a non-negative floating point number rounded to two decimal places celsius, that denotes the temperature in Celsius. You should convert Celsius into Kelvin and Fahrenheit a leetcode.com 섭씨 온도를 나타내는 소수점 둘째 자리 섭씨로 반..
1920. Build Array from Permutation
순열로 이루어진 배열 재구성하는 문제 https://leetcode.com/problems/build-array-from-permutation/description/ 0부터 시작하는 순열로 이루어진 배열 nums가 주어진다. 이와 동일한 길이를 가지는 ans 배열을 반환하라. ans[i] = nums[nums[i]] class Solution { public int[] buildArray(int[] nums) { int len = nums.length; int[] ans = new int[len]; for(int idx = 0; idx < len; idx++){ ans[idx] = nums[nums[idx]]; } return ans; } }