Category Archives: Advanced Data Structure

Weighted Prefix Search

Given n strings and a weight associated with each string. The task is to find the maximum weight of string having the given prefix. Print “-1” if no string is present with given prefix. Examples: Input : s1 = “geeks”, w1 = 15 s2 = “geeksfor”, w2 = 30 s3 = “geeksforgeeks”, w3 = 45… Read More »