Round 1
Questions: Given an array and a range [lowVal, highVal], partition the array into three parts: 1️⃣ All elements smaller than lowVal come first. 2️⃣ All elements in the range [lowVal, highVal] come next. 3️⃣ All elements greater than highVal come last.
Additionally:
- If lowVal and highVal exist in the array, ensure that lowVal appears before highVal in the final result.
- The relative order of elements within each group doesn’t matter.
Input:
arr[] = {1, 14, 5, 20, 4, 2, 54, 20, 87, 98, 3, 1, 32} lowVal = 14, highVal = 20
Output:
arr[] = {1, 5, 4, 2, 1, 3, 14, 20, 20, 98, 87, 32, 54}
It will be solved like: Leetcode Problem
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.