Skip to content
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

working in the count() #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions src/main/java/Main.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Main {
public class Main {

public String readRawDataToString() throws Exception{
public String readRawDataToString() throws Exception {
ClassLoader classLoader = getClass().getClassLoader();
String result = IOUtils.toString(classLoader.getResourceAsStream("RawData.txt"));
return result;
}

public static void main(String[] args) throws Exception{
public static void main(String[] args) throws Exception {
String output = (new Main()).readRawDataToString();
System.out.println(output);

}
}


// count() how many time I see the item and the prices.
public static Integer counter(List<String> prices) {
ArrayList<String> counts = new ArrayList<>();
for (int i = 0; i < prices.size(); i++) {
if(pr)


}
return null;
}
}
Binary file modified target/classes/Main.class
Binary file not shown.