Posts with tag 'heap'

K Unique String

1 minute read

Given a string s of lowercase alphabet characters, and an integer k, return the minimum number of changes needed in the string (one change involves changing ...

Merging K Sorted Lists

less than 1 minute read

Given a list of sorted lists of integers, merge them into one large sorted list.

Selling Products

1 minute read

You are given a list of integers items and an integer n. A salesperson has items in a bag with random IDs. The salesperson can remove as many as n items from...

One Integer

1 minute read

You are given a list of integers nums. You can reduce the length of nums by taking any two integers, removing them, and appending their sum to the end. The c...

Cell Fusion

1 minute read

You are given a list of integers cells, representing sizes of different cells. In each iteration, the two largest cells a and b interact according to these r...

Back to top ↑