- Diameter of Tree
- Given two arrays old_profit and new_profit of size n the place old_profit[ i ] and new_profit[ i ] symbolize revenue from store within the previous metropolis and new metropolis respectively at day i+1. You must shift the store from the previous metropolis to the brand new metropolis such that the whole revenue is most. Discover the utmost revenue.
old_profit = [5 , 25, 10, 7 , 9 , 11] new_profit= [10 , 5, 11, 13, 7, 14] Output: 75 Clarification: Day - Revenue 1 - 5 2 - 25 Now shift the store to new place 3 - 11 4 - 13 5 - 7 6 - 14 So the whole most revenue turns into 75
- Would you be capable of change to a different language?
- Firstly Interviewer requested me for an method as soon as he was totally happy with the method then he advised me to do the code. Once I was achieved with coding, he gave me some check instances to dry run. After that, he requested me about area and time Complexity of code.
- I used to be free to code in any language ( I selected Python).
- There was just one interview spherical.