...

/

Challenge 2: Find the k Smallest Elements in an Array

Challenge 2: Find the k Smallest Elements in an Array

Try to solve the Find k Smallest Elements in an Array problem.

Statement

Given an unsorted array arr and an integer k, find the k smallest elements from the array using a Heap.

Constraints:

  • 11 \leq arr.length 103\leq 10^3
...