Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 338 Bytes

Merge_Packages.md

File metadata and controls

5 lines (3 loc) · 338 Bytes

#Merging 2 Packages

Given a package with a weight limit and an array arr of item weights, how can you most efficiently find two items with sum of weights that equals the weight limit?

Your function should return 2 such indices of item weights or -1 if such pair doesn't exist. What is the runtime and space complexity of your solution?