โ† Arista Networks questions
CodingMedium

Minimum hits to break all wooden planks using two types of hammers

Filed under Arista Networks

The question

Given n wooden planks with varying strengths and two types of hammers. A type 1 hammer reduces strength to 0 in one blow and can be used at most k times. A type 2 hammer reduces strength by 1 per hit. Find the minimum number of hits to break all planks, the indexes of planks broken by type 1 hammer in descending order of strengths, and the number of hits by type 2 hammer.

No write-up yet. Related questions below have one.

Related Arista Networks questions

Collected from public candidate posts and coding forums. Updated Nov 2026.