/HackerRankJava

A collection of solutions to select problems on HackerRank.com, written in Java.

Primary LanguageJava

HackerRank - Java

A collection of solutions to select problems found on HackerRank.

Solutions to ongoing challenges are not included in this repository. Additionally, please do not use any code in this repository for any current HackerRank challenges.

Categories

  1. Algorithms
  2. Artificial Intelligence
  3. Miscellaneous

Note: This repository focuses on solutions in Java. As such functional programming challenges are not included.

Naming

Hackerrank's testing system requires that all Java solutions are executed via a java class named Solution. Normally Java files are named after the class contained therein. In order to increase readability the files in this repo have been named after the Hackerrank challenge they correspond to.

If you'd like to run one of these solutions independently of the Hackerrank system you will need to rename them to Solution.java.

Example Usage

The below are example linux commands to compile and run a Java program designed for Hackerrank. The first command compiles Solution.java into a file Solution.class. The second command runs the Solution program and feeds the contents of the file input.txt into it. In this example the file input.txt should contain the test cases for the challenge specific to that solution.

Javac Solution.java Java Solution < input.txt

Disclaimer

The code contained herein is intended for practice only.