This project is a Spring Boot Kotlin application that finds pairs of integers in an array whose sum equals a given target value.
- Accepts user input via the command line.
- Handles negative numbers, duplicates, and trailing spaces.
- Supports multiple pairs
- Includes unit tests
- Kotlin (Language)
- Spring Boot (Framework)
- Maven (Build Tool)
- JUnit 5 (Testing Framework)
- Java 17 or later installed.
- Maven 3.4.1 installed.
- Clone the repository:
git clone https://github.com/beheidary/kotlinProject.git cd kotlinProject - Build the project:
mvn clean install
- Run the application:
mvn spring-boot:run
<array of integers> <target sum>
Input:
4 6 -11 1 8 2 56 26 36 10
Output:
Input Array: 4, 6, -11, 1, 8, 2, 56, 26, 36
Target Sum: 10
Pair found: 4 and 6
Pair found: -11 and 1
Pair found: 8 and 2
Type:
exit
Run all tests:
mvn testSample test cases include:
- Finding multiple pairs.
- Handling invalid inputs.
- Managing edge cases like duplicates and negative numbers.