In this article, we will explore how we can get the minimum number of deletion of smallest element such that the smallest element in the first array divides all the elements in the second array. This will involve the concept of Min Heap and Hash Map.
Pre-requisites
Basic maths
Greatest Common Divisor (GCD)Min HeapHash MapProblem statement
You are given two positive integer arrays nums and numsDivide. You can delete any number of elements from nums.
Return the minimum number of deletions suc...
Published on March 22, 2023 00:01