Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please solve in Java please solve in Java Every project on Thumbtack belongs to a category. Each set of two categories has a relevance score
please solve in Java
please solve in Java
Every project on Thumbtack belongs to a category. Each set of two categories has a relevance score from 0 to 1, which represents how relevant they are to each other. A category has a relevance score of 1.0 to itself 1:52 House und Mutas. WM YUR OP S C D M LI x IN 123 Every time a project that belongs to a user is completed, the Thumbtack search bar updates to display the k most relevant category suggestions for that user. These top categories are chosen by first sorting all the categories that are relevant to at least one of the already created projects by relevance. Then, in the case that their relevance is equal, they should be sorted by category name. If the same category is relevant to 2 or more projects, it should be included only once with the maximum relevance score. If there are fewer than k total relevant projects, the suggestions list will be shorter than k. You have a relevance graph of all the Thumbtack categories, represented as an array of strings of comma-separated words. For each string in categories, the first two elements are the categories being compared and the third is their relevance score. You are also given an array of the categories of the projects that a particular user wants to create. For example: "House Painting, Interior Painting, c.8" means that House Painting and Interior Painting have a relevance score ofAslie highly relevanti h 5m left ALL same category is relevant to 2 or more projects, it should be included only once with the maximum relevance score. If there are fewer than k total relevant projects, the suggestions list will be shorter than k. You have a relevance graph of all the Thumbtack categories, represented as an array of strings of comma-separated words. For each string in categories, the first two elements are the categories being compared and the third is their relevance score. You are also given an array of the categories of the projects that a particular user wants to create. For example: "House Painting, Interior Painting,0.8" means that House Painting and Interior Painting have a relevance score of 0.8 (i.e. highly relevant) and "Handyman, Massage Therapy, 0.1" means that Handyman and Massage Therapy have a relevance score of 8.1 (i.e. barely relevant). Note that if there is no entry for particular pair of categories, it means that their relevance is 0.0 (i.e. they aren't relevant at all and they shouldn't be included in the list of suggestions). Given the relevance graph categories, the list of the user's projects, and the number of category suggestions the user should see in the Thumbtack search bar k, return an array of arrays that represents the state of the search bar suggestions list after each of the projects in projects is created. Example For 1 2 categories = [ "House Painting, Interior Painting,0.9", "Handyman, Massage Therapy,0.1", "Handyman, House Painting,0.5", House Painting, House Cleaning,0.6", "Furniture Assembly, Handyman, 0.8", "Furniture Assembly,Massage Therapy,0.1", "Plumbing Drain Repair,Junk Removal,0.3" ] 3 projects = ["House Painting", "Handyman"), and k = 3, the output should be categorySuggestions(categories, projects, k) = [["House Painting", "Interior Painting", "House Cleaning"], ["Handyman", "House Painting", "Interior Painting"]). ant Cuggestions are in order of their relevance): Ich set of two categories has a relevance score from o to 1, which repre ant they are to each other category as a reescore of 12 otte's He has QWERTYU OP ASDFGHJK 2 XCVBNM Every time a project that belongs to a user is completed, the Thumbtack search bar updates to display the k most relevant category suggestions for that user. These top categories are chosen by first sorting all the categories that are relevant to at least one of the already created projects by relevance. Then, in the case that their relevance is equal, they should be sorted by category name. If the same category is relevant to 2 or more projects, it should be included only once with the maximum relevance score. If there are fewe than k total relevant projects, the suggestions list will be shorter than k. You have a relevance graph of all the Thumbtack categories, represented as an array of strings of comma-separated words. For eac string in categories, the first two elements are the categories being compared and the third is their relevance score. You are also giv an array of the categories of the projects that a particular user wants to create. For example: "House Painting, Interior Painting,0.8" means that House Painting and Interior Painting have a relevance score of 0.8 (.e. highly relevant) and "Handyman, Massage Therapy,0.1" means that Handyman and Massage Therapy have a relevance score of 8.1 (.e. barely relevant). Note that if there is no entry for particular pair of categories, it means that their relevance is 0. (.e. they aren't relevant at all and they shouldn't be included in the list of suggestions). Gotbal the line of our data number of Retinere children in House Painting 1.0 Interior Painting 0.9 House Cleaning 0.6 Handyman 0.5 After the second project is completed, the most relevant suggestions are: Category Relevance Handyman 1.0 House Painting 1.0 Interior Painting 0.9 Furniture Assembly 0.8 House Cleaning 0.6 Massage Therapy 0.1 Input/Output (input array.string categories Category relevancies given in the formatStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started