Minimum Deletions to Make Array Divisible [3 Solutions]

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 mathsGreatest 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...

 •  0 comments  •  flag
Share on Twitter
Published on March 22, 2023 00:01
No comments have been added yet.