Skip to content

Create AverageBetweenIndices.py #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aishwaryanevrekar
Copy link

Given an array arr of size n, and two intervals x and y. Find the average of elements which lies between the given intervals inclusively.

Input Format
First Parameter - number n

Second Parameter - array arr of size n

Third Parameter - number x

Fourth Parameter - number y

Output Format
Return the decimal value

Example 1:
Input:
6
6 2 5 4 3 1
2
5
Output:
3.25
Explanation:
The elements between indices 2 and 5 are 5, 4, 3 and 1. The Average is:
(5 + 4 + 3 + 1) / 4 = 3.25
Example 2:
Input:
2
7 2
0
1
Output:
4.5
Explanation:
The elements between indices 0 and 1 are 7 and 2. The average is:
(7 + 2) / 2 = 4.5

Given an array arr of size n, and two intervals x and y. Find the average of elements which lies between the given intervals inclusively.

Input Format
First Parameter - number n

Second Parameter - array arr of size n

Third Parameter - number x

Fourth Parameter - number y

Output Format
Return the decimal value

Example 1:
Input:
    6
    6 2 5 4 3 1
    2
    5
Output:
    3.25
Explanation:
    The elements between indices 2 and 5 are 5, 4, 3 and 1. The Average is: 
         (5 + 4 + 3 + 1) / 4 = 3.25
Example 2:
Input:
    2
    7 2
    0
    1
Output:
    4.5
Explanation:
    The elements between indices 0 and 1 are 7 and 2. The average is:
        (7 + 2) / 2 = 4.5
@py3-coder
Copy link
Owner

same error found need to fix it out the file that you committed must inside python folder @aishwaryanevrekar
Make it in proper format.
Contribution Not done in correct dir will considered as wrong..
Make it correct

@py3-coder py3-coder added the Need Fix. Wrong Directory File Commit Found or File extension not found label Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need Fix. Wrong Directory File Commit Found or File extension not found
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants