You are appointed as head of the citizen authority of your locality. Your task is to find
Fantastic news! We've Found the answer you've been seeking!
Question:
You are appointed as head of the citizen authority of your locality. Your task is to find out the number of good citizens in your locality. You are given an array Behaviour where Behavioural] denotes the Behaviour of ith Citizen in the locality. A citizen can be considered a good citizen if the Behaviour of that citizen is greater than the average of two neighboring citizens i.e. Behaviouri]> Behaviour(i+1)+ Behaviour(i−1))/2. Note: If Behaviour[i+1] or Behaviouri−1] does not exist. they should be considered zero. You are given an integer N where N represents the totall number of citizens in the Locality. You are given an array of positive integers Behaviour whose Behaviour] represents the Behaviour of th Citizen in the locality.
Determine the number of good citizens in your locality.
Related Book For
Business and Administrative Communication
ISBN: 978-0073403182
10th edition
Authors: Kitty o. locker, Donna s. kienzler
Posted Date: