Yahoo India Web Search

Search results

  1. Mar 23, 2021 · Learn how to solve the plus minus problem on HackerRank using C, C++, Java, Python and JavaScript. See the input, output and code examples for each language.

    • Task
    • Input Format
    • Output Format
    • Solution – Plus Minus
    • GeneratedCaptionsTabForHeroSec

    Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6places after the decimal. Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute error of up to 10-4are accept...

    The first line contains an integer, n, the size of the array. The second line contains n space-separated integers that describe arr[n].

    Printthe following lines, each to decimals: 1. proportion of positive values 2. proportion of negative values 3. proportion of zeros Sample Input Sample Output Explanation There are 3 positive numbers, 2 negative numbers, and 1 zero in the array. The proportions of occurrence are positive: 3/6 = 0.500000, negative: 2/6 = 0.333333 and zeros: 1/6 = 0...

    Java

    Disclaimer: The above Problem (Plus Minus) is generated by Hacker Rank but the Solution is Provided by CodingBroz. This tutorial is only for Educational and LearningPurpose.

    Learn how to solve the Plus Minus challenge on HackerRank, which involves calculating the ratios of positive, negative and zero values in an array. See the problem statement, input format, constraints and code solutions in C, C++, Java and Python.

  2. www.hackerrank.com › challenges › plus-minusPlus Minus | HackerRank

    Learn how to calculate the ratios of positive, negative and zero values in an array using C++. See the problem statement, input and output format, sample input and output, and code solution on HackerRank.

  3. Jul 28, 2021 · Learn how to solve the plus minus challenge on HackerRank using different programming languages. The challenge involves calculating the ratios of positive, negative and zero elements in an array of integers.

  4. Plus Minus | HackerRank Solutions. Problem Statement : Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6 places after the decimal. Note: This challenge introduces precision problems.

  5. Jun 1, 2020 · Learn how to solve the plus minus challenge on Hackerrank using Python. The solution prints the fractions of positive, negative and zero elements in an array to six decimal places.

  6. Apr 7, 2018 · This is a simple and fast solution: you can use the filter function to iterate in the array and get a new array only with the numbers that fulfill the condition; positive (n> 0), negative (n <0) and neutral (n == 0) numbers.

  1. People also search for