Modified version of Group Anagrams (available on Leetcode)
I have n Meals where a meal is comprised of a bunch of ingredients and has a name.
I needed to identify how many unique meals are on the menu where two meals are unique if they don’t have the exact same ingredients.
Return value was the number of unique meal.
Coding Assignment: Find the distance from root Business to other businesses in an acyclic graph
I have been given a root Business which contains the name of the business and a hashmap<Business, Integer> where integer contains the distance from the parent.
I have been given a target distance.
If the business is within or equal to the target distance add it to the resulting list.
output:
list of biz_ids that are active businesses.
An active business is the one who has more than (or equal to) 2 event_types with more than average occurances amoung all biz_ids
for example:
average for “review”, “ads”, “page_views” are 7+3/2 = 5, 11+7+6=8, 3+12/2=7.5
biz_id 1 has 7 “review” events > 5, 11"ads" events > 8, so biz_id 1 is an active business.