Algorithm
Coding Test Meeting #4
이번 문제 https://leetcode.com/problems/number-of-ways-to-select-buildings/ Number of Ways to Select Buildings - LeetCode Can you solve this real interview question? Number of Ways to Select Buildings - You are given a 0-indexed binary string s which represents the types of buildings along a street where: * s[i] = '0' denotes that the ith building is an office and * s[i] = '1 leetcode.com Code 더보기 /..
2418. Sort the People
https://leetcode.com/problems/sort-the-people/ Sort the People - LeetCode Can you solve this real interview question? Sort the People - You are given an array of strings names, and an array heights that consists of distinct positive integers. Both arrays are of length n. For each index i, names[i] and heights[i] denote the name leetcode.com 문자열 이름의 배열과 고유한 양의 정수로 구성된 배열 높이가 제공됩니다. 두 배열의 길이는 n입니다..
1913. Maximum Product Difference Between Two Pairs
https://leetcode.com/problems/maximum-product-difference-between-two-pairs/ Maximum Product Difference Between Two Pairs - LeetCode Can you solve this real interview question? Maximum Product Difference Between Two Pairs - The product difference between two pairs (a, b) and (c, d) is defined as (a * b) - (c * d). * For example, the product difference between (5, 6) and (2, 7) is (5 * 6 leetcode...
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..