From 6cff57180d4c17f70f2446c0b7e1e4dfcae4aa70 Mon Sep 17 00:00:00 2001 From: Amrit Sahani Date: Thu, 19 Mar 2020 13:54:31 +0530 Subject: [PATCH] Update FindProduct.java As long data type is not present, the code shows error as data goes in cyclic integers --- .../basicInputOutput/FindProduct.java | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/src/com/hackerrank/practices/basicInputOutput/FindProduct.java b/src/com/hackerrank/practices/basicInputOutput/FindProduct.java index f52f062..f404de5 100644 --- a/src/com/hackerrank/practices/basicInputOutput/FindProduct.java +++ b/src/com/hackerrank/practices/basicInputOutput/FindProduct.java @@ -1,33 +1,22 @@ -package com.hackerrank.practices.basicInputOutput; - -import com.hackerrank.practices.DataStructure.IPracticeSolution; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -public class FindProduct implements IPracticeSolution { - - /** - * Link - https://www.hackerearth.com/practice/basic-programming/input-output/basics-of-input-output/practice-problems/algorithm/find-product/ - * @throws IOException - */ - - @Override - public void startSolution() throws IOException { - - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); - bufferedReader.readLine(); - String[] input = bufferedReader.readLine().split(" "); - - int product = 1; - int m = 1000000007; - for (int i=0;i