countCandies has the following parameter(s): There are friends_nodes friends, number different candies. There are friends is connected by the common candy that they both like. Candies are numbered 1 to friends_nodes, who like to eat lof friends where each pair Open with - friends friends_nodes: an integer, the number of friends friends_from[friends_from[0,.friends_from[n-1]]: an integer array where each from 1 to 100. Note that if xi] and y] are connected by a candy cfi]and yfi] and zi] element denotes the first friend in the pair are also connected by the candy cli], then x[i] and zī] are also said to be connected friends_toffriends_to[0]...friends_to[n-1]]: an integer array where each element denotes the second friend in the pair by cf]. Find the maximal product of x[i] and yli] so that x[i] and y[i] share the largest group of friends which is connected by some common candy. As an example, assume the following 6 inputs: From To Candy 1 51 51 6. 51 10 8 51 6 51 2. 3 51 Everyone likes the same candy, but not everyone is connected. A graphical friends_weightffriends_weight(0],.friends_weight[n-1]: an integer array where representation is: each element denotes a candy liked by both friends The largest group is [1, 2, 3, 7] and its largest elements are 3 and 7. Their product is Constraints 2 s friends_nodes s 100 1 s friends_edges s min(200, e 1s friends_weight[i] s 100 1s friends_from[i]), friends_to[i] s friends_nodes 1s friends_weight[i] s friends_edges friends from[i] friends toli Each pair of friends can 21. Function Description Complete the function countCandies in the editor below. The function must return an integer that represents t Page + numbers in the largest of candy group
countCandies has the following parameter(s): There are friends_nodes friends, number different candies. There are friends is connected by the common candy that they both like. Candies are numbered 1 to friends_nodes, who like to eat lof friends where each pair Open with - friends friends_nodes: an integer, the number of friends friends_from[friends_from[0,.friends_from[n-1]]: an integer array where each from 1 to 100. Note that if xi] and y] are connected by a candy cfi]and yfi] and zi] element denotes the first friend in the pair are also connected by the candy cli], then x[i] and zī] are also said to be connected friends_toffriends_to[0]...friends_to[n-1]]: an integer array where each element denotes the second friend in the pair by cf]. Find the maximal product of x[i] and yli] so that x[i] and y[i] share the largest group of friends which is connected by some common candy. As an example, assume the following 6 inputs: From To Candy 1 51 51 6. 51 10 8 51 6 51 2. 3 51 Everyone likes the same candy, but not everyone is connected. A graphical friends_weightffriends_weight(0],.friends_weight[n-1]: an integer array where representation is: each element denotes a candy liked by both friends The largest group is [1, 2, 3, 7] and its largest elements are 3 and 7. Their product is Constraints 2 s friends_nodes s 100 1 s friends_edges s min(200, e 1s friends_weight[i] s 100 1s friends_from[i]), friends_to[i] s friends_nodes 1s friends_weight[i] s friends_edges friends from[i] friends toli Each pair of friends can 21. Function Description Complete the function countCandies in the editor below. The function must return an integer that represents t Page + numbers in the largest of candy group
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
I need the answer quickly
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education