[LeetCode] 2542. Maximum Subsequence Score, Medium
·
CodingTest/LeetCode
1. 문제정수 배열 nums1과 nums2가 주어질 때, k개의 인덱스를 선택해서 nums1의 합 * nums2의 최소값이 최대가 되는 값을 구하라.2. 해결class MinHeap { private heap: number[]; constructor() { this.heap = []; } getLeftChildIndex = (parentIndex) => parentIndex * 2 + 1; getRightChildIndex = (parentIndex) => parentIndex * 2 + 2; getParentIndex = (childIndex) => Math.floor((childIndex - 1) /2); swap = (i: number, j: num..