Question: required answer in python programming Electrostatics Doug is fond of change, every now and then he tries to do new things. This time, he caught



required answer in python programming
Electrostatics Doug is fond of change, every now and then he tries to do new things. This time, he caught up with a rod comprising of negative (N) and positive (P) charges. He is asked to calculate the maximum net electrostatic field possible in the region due to the-rod. Note: Assume, Electrostatic Field = Total charge 100 Input Specification: input1: integer array denoting the magnitude of each charge input2: String denoting nature of each charge, ith entry represents a sign of charge at ith location in input1 input3: No. of charges it holds (length of input 1 ) Output Specification: Return the maximum electrostatic field possible in the rod. Example 1: input1: {4,3,5} input2: PNP input 3:3 Output: 600 Example 1: input 1:{4,3,5} input2: PNP input3: 3 Output: 600 Explanation: The maximum electric charge on the rod is 43+5=6 units, so the magnitude of the electric field would be 6100=600. Example 2: input 1:{2,3} input2: PN input 3:2 Output: 100 Explanation: The maximum possible electric charge on the section of the rod is 23=1 unit. As the magnitude is never negative so 1=1 so the magnitude of the electric field would be 1100=100. \# Read only region start class Usermaincode (object): @classmethod def findmaximum(cls, input1, input2, input3): input1 : int [] input2 : string input3 : int Expected return type : int \# Read only region end \# Write code here pass Use Custom Input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
