Skip to content

Instantly share code, notes, and snippets.

View mihir1125's full-sized avatar
🎯
Focusing

Mihir Manjrekar mihir1125

🎯
Focusing
View GitHub Profile
@mihir1125
mihir1125 / 1_question.txt
Last active October 5, 2025 08:51
DSA Array Question
You have an array A of size N.
You want to move this array to a new array B.
You can move one element at a time.
Each time you place an element, there is a cost associated with it.
The cost of placing an element in B is equal to the difference between the maximum and minimum element in B (after placing the element from A).
Example 1
N = 3
A = 3, 1, 9