Skip to content

Commit 9d69dd5

Browse files
[Java] Reverse String
1 parent 6263b96 commit 9d69dd5

File tree

10 files changed

+587
-0
lines changed

10 files changed

+587
-0
lines changed

java/reverse-string/HELP.md

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Help
2+
3+
## Running the tests
4+
5+
Choose your operating system:
6+
7+
- [Windows](#windows)
8+
- [macOS](#macos)
9+
- [Linux](#linux)
10+
11+
## Windows
12+
13+
1. Open a Command Prompt.
14+
2. Get the first exercise:
15+
16+
```batchfile
17+
C:\Users\JohnDoe>exercism download --exercise hello-world --track java
18+
```
19+
20+
3. Change directory into the exercism:
21+
22+
```batchfile
23+
C:\Users\JohnDoe>cd C:\Users\JohnDoe\exercism\java\hello-world
24+
```
25+
26+
4. Run the tests:
27+
28+
```batchfile
29+
C:\Users\JohnDoe>gradlew.bat test
30+
```
31+
32+
_(Don't worry about the tests failing, at first, this is how you begin each exercise.)_
33+
34+
5. Solve the exercise. Find and work through the `instructions.append.md` guide ([view on GitHub](https://github.com/exercism/java/blob/main/exercises/practice/hello-world/.docs/instructions.append.md#tutorial)).
35+
36+
Good luck! Have fun!
37+
38+
## macOS
39+
40+
1. In the terminal window, get the first exercise:
41+
42+
```sh
43+
exercism download --exercise hello-world --track java
44+
```
45+
46+
2. Change directory into the exercise:
47+
48+
```sh
49+
cd /Users/johndoe/exercism/java/hello-world
50+
```
51+
52+
3. Run the tests:
53+
54+
```sh
55+
./gradlew test
56+
```
57+
58+
_(Don't worry about the tests failing, at first, this is how you begin each exercise.)_
59+
60+
4. Solve the exercise. Find and work through the `instructions.append.md` guide ([view on GitHub](https://github.com/exercism/java/blob/main/exercises/practice/hello-world/.docs/instructions.append.md#tutorial)).
61+
62+
Good luck! Have fun!
63+
64+
## Linux
65+
66+
1. In the terminal window, get the first exercise:
67+
68+
```sh
69+
exercism download --exercise hello-world --track java
70+
```
71+
72+
2. Change directory into the exercise:
73+
74+
```sh
75+
cd /home/johndoe/exercism/java/hello-world
76+
```
77+
78+
3. Run the tests:
79+
80+
```sh
81+
./gradlew test
82+
```
83+
84+
_(Don't worry about the tests failing, at first, this is how you begin each exercise.)_
85+
86+
4. Solve the exercise. Find and work through the `instructions.append.md` guide ([view on GitHub](https://github.com/exercism/java/blob/main/exercises/practice/hello-world/.docs/instructions.append.md#tutorial)).
87+
88+
Good luck! Have fun!
89+
90+
## Submitting your solution
91+
92+
You can submit your solution using the `exercism submit src/main/java/ReverseString.java` command.
93+
This command will upload your solution to the Exercism website and print the solution page's URL.
94+
95+
It's possible to submit an incomplete solution which allows you to:
96+
97+
- See how others have completed the exercise
98+
- Request help from a mentor
99+
100+
## Need to get help?
101+
102+
If you'd like help solving the exercise, check the following pages:
103+
104+
- The [Java track's documentation](https://exercism.org/docs/tracks/java)
105+
- The [Java track's programming category on the forum](https://forum.exercism.org/c/programming/java)
106+
- [Exercism's programming category on the forum](https://forum.exercism.org/c/programming/5)
107+
- The [Frequently Asked Questions](https://exercism.org/docs/using/faqs)
108+
109+
Should those resources not suffice, you could submit your (incomplete) solution to request mentoring.
110+
111+
If you need some help you can visit these resources:
112+
113+
- [Stack Overflow](https://stackoverflow.com/questions/tagged/java),
114+
- [The Java subreddit](https://www.reddit.com/r/java),
115+
- [Official Java documentation](https://docs.oracle.com/en/java/javase/11/docs/api/index.html).

java/reverse-string/README.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Reverse String
2+
3+
Welcome to Reverse String on Exercism's Java Track.
4+
If you need help running the tests or submitting your code, check out `HELP.md`.
5+
6+
## Introduction
7+
8+
Reversing strings (reading them from right to left, rather than from left to right) is a surprisingly common task in programming.
9+
10+
For example, in bioinformatics, reversing the sequence of DNA or RNA strings is often important for various analyses, such as finding complementary strands or identifying palindromic sequences that have biological significance.
11+
12+
## Instructions
13+
14+
Your task is to reverse a given string.
15+
16+
Some examples:
17+
18+
- Turn `"stressed"` into `"desserts"`.
19+
- Turn `"strops"` into `"sports"`.
20+
- Turn `"racecar"` into `"racecar"`.
21+
22+
For more help on how to solve this exercise, please refer to the tutorial provided as part of the [hello world](https://exercism.org/tracks/java/exercises/hello-world) exercise.
23+
24+
## Source
25+
26+
### Created by
27+
28+
- @bmkiefer
29+
30+
### Contributed to by
31+
32+
- @barisozcanli
33+
- @FridaTveit
34+
- @ikhadykin
35+
- @jmrunkle
36+
- @Kyle-Pu
37+
- @lemoncurry
38+
- @mirkoperillo
39+
- @msomji
40+
- @muzimuzhi
41+
- @ppiliar
42+
- @sjwarner
43+
- @sjwarner-bp
44+
- @SleeplessByte
45+
- @Smarticles101
46+
- @sshine
47+
48+
### Based on
49+
50+
Introductory challenge to reverse an input string - https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb

java/reverse-string/build.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
plugins {
2+
id "java"
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testImplementation platform("org.junit:junit-bom:5.10.0")
11+
testImplementation "org.junit.jupiter:junit-jupiter"
12+
testImplementation "org.assertj:assertj-core:3.25.1"
13+
}
14+
15+
test {
16+
useJUnitPlatform()
17+
18+
testLogging {
19+
exceptionFormat = "full"
20+
showStandardStreams = true
21+
events = ["passed", "failed", "skipped"]
22+
}
23+
}
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
validateDistributionUrl=true
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)