Trying to solve questions with Java 8 lingo.
Some where the decision to use Java-8 has not be made because of time considerations. The whole idea is to practice more of Java-8 lingo and get familiar with newer concepts in Java-8.
If you're using these codes, please don't blindly copy them in hackerrank.
I am providing the input of these snippets using the file resource (input.txt
).
- Clone this repo
- Import it as a Java project in IDE
- Copy the sample input in hackerrank question to
input.txt
-
Copy the code to hackerrank editor.
-
Remove the package name.
package {xyz};
-
Change the class name to
Solution
public class Solution
-
Change the input mechanism to Hackerrank complaint.
Scanner sc = new Scanner(System.in);
Disclaimer : I am a Java-8 noob and I am trying to come up with best solutions in Java-8. These solutions might not be the best solutions algorithmatically and / or in terms of Java-8 complaint. I am open to all kinds of suggestions/criticism/discussions regarding these solutions. If you have better and effective Java-8 solutions for these problems please put it forward. It'll be a learning experience for me too.