Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Coding 7 7 3 Description Problem Statement There are n cities and m one - directional roads connecting the city A [ i ] to
Coding
Description
Problem Statement
There are cities and onedirectional roads connecting the city to city We are in the pannermaking business. Each city has set its own price of paneer. You can buy or sell paneer in the city i for val rupees. You have to bury paneer from some city u and sell the paneer in another city The profit that you make is calculated as the selling price minus buying price. Return an integer denoting the maximum profit you can make. NOTE: In all, it is mandatory to buy only paneer and it is mandatory to sell that paneer in some other city that can be travelled from it
Input Format
The firstline contains the number of qities.
The next lines contain the elements of the array val.
The next line contains an integer m
The next m lines contain the array of elements
The next line again contains the integer
The next m lires contain the array of clements B
Constraints
Step 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