Skip to content
Finding target sum in number array.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
README.md
pom.xml

README.md

Sum of Two Elements

Given a target number and integer array, find all unique pairs of elements whose summation is equal to the target number. Java solution explained in detail on my website.

Steps to set up development environment in Eclipse

  1. Download or clone the project from GitHub.

  2. Navigate to the project directory and run the following from the command line:

    $ mvn package

  3. Open Eclipse in order to import the project.

  4. File -> Import -> Maven -> Existing Maven Projects (Navigate to folder and import)

src/main/java

The Main class in the com.chrisbaileydeveloper.sumoftwoelements package holds the solution.

src/test/java

The MainTest class in the com.chrisbaileydeveloper.sumoftwoelements package holds the JUnit test cases.

Development environment

Windows 7 64bit, Eclipse IDE STS Luna 4.4.1, Maven 3.1.0

Author

Chris Bailey

You can’t perform that action at this time.