Skip to content

Commit 9350f0e

Browse files
authored
Add stubs to practice exercises W to Z (exercism#2188)
1 parent fa98e68 commit 9350f0e

5 files changed

Lines changed: 67 additions & 44 deletions

File tree

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
/*
1+
import java.util.Map;
22

3-
Since this exercise has a difficulty of > 4 it doesn't come
4-
with any starter implementation.
5-
This is so that you get to practice creating classes and methods
6-
which is an important part of programming in Java.
7-
8-
Please remove this comment when submitting your solution.
9-
10-
*/
3+
class WordCount {
4+
public Map<String, Integer> phrase(String input) {
5+
throw new UnsupportedOperationException("Please implement the WordCount.phrase() method.");
6+
}
7+
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
/*
1+
import java.util.Map;
2+
import java.util.Optional;
3+
import java.util.Set;
24

3-
Since this exercise has a difficulty of > 4 it doesn't come
4-
with any starter implementation.
5-
This is so that you get to practice creating classes and methods
6-
which is an important part of programming in Java.
7-
8-
Please remove this comment when submitting your solution.
9-
10-
*/
5+
class WordSearcher {
6+
Map<String, Optional<WordLocation>> search(final Set<String> words, final char[][] grid) {
7+
throw new UnsupportedOperationException("Please implement the WordSearcher.search() method.");
8+
}
9+
}
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
/*
2-
3-
Since this exercise has a difficulty of > 4 it doesn't come
4-
with any starter implementation.
5-
This is so that you get to practice creating classes and methods
6-
which is an important part of programming in Java.
7-
8-
Please remove this comment when submitting your solution.
9-
10-
*/
1+
class WordProblemSolver {
2+
int solve(final String wordProblem) {
3+
throw new UnsupportedOperationException("Please implement the WordProblemSolver.solve() method.");
4+
}
5+
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
/*
1+
class ZebraPuzzle {
2+
String getWaterDrinker() {
3+
throw new UnsupportedOperationException("Please implement the ZebraPuzzle.getWaterDrinker() method.");
4+
}
25

3-
Since this exercise has a difficulty of > 4 it doesn't come
4-
with any starter implementation.
5-
This is so that you get to practice creating classes and methods
6-
which is an important part of programming in Java.
7-
8-
Please remove this comment when submitting your solution.
9-
10-
*/
6+
String getZebraOwner() {
7+
throw new UnsupportedOperationException("Please implement the ZebraPuzzle.getZebraOwner() method.");
8+
}
9+
}
Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,43 @@
1-
/*
1+
class Zipper {
2+
Zipper(int val) {
3+
throw new UnsupportedOperationException("Please implement the Zipper(int) constructor.");
4+
}
25

3-
Since this exercise has a difficulty of > 4 it doesn't come
4-
with any starter implementation.
5-
This is so that you get to practice creating classes and methods
6-
which is an important part of programming in Java.
6+
BinaryTree toTree() {
7+
throw new UnsupportedOperationException("Please implement the Zipper.toTree() method.");
8+
}
79

8-
Please remove this comment when submitting your solution.
10+
int getValue() {
11+
throw new UnsupportedOperationException("Please implement the Zipper.getValue() method.");
12+
}
913

10-
*/
14+
Zipper setLeft(Zipper leftChild) {
15+
throw new UnsupportedOperationException("Please implement the Zipper.setLeft() method.");
16+
}
17+
18+
Zipper setRight(Zipper rightChild) {
19+
throw new UnsupportedOperationException("Please implement the Zipper.setRight() method.");
20+
}
21+
22+
void setValue(int val) {
23+
throw new UnsupportedOperationException("Please implement the Zipper.setValue() method.");
24+
}
25+
}
26+
27+
class BinaryTree {
28+
BinaryTree(int value) {
29+
throw new UnsupportedOperationException("Please implement the BinaryTree(int) constructor.");
30+
}
31+
32+
BinaryTree(Zipper root) {
33+
throw new UnsupportedOperationException("Please implement the BinaryTree(Zipper) constructor.");
34+
}
35+
36+
Zipper getRoot() {
37+
throw new UnsupportedOperationException("Please implement the BinaryTree.getRoot() method.");
38+
}
39+
40+
String printTree() {
41+
throw new UnsupportedOperationException("Please implement the BinaryTree.printTree() method.");
42+
}
43+
}

0 commit comments

Comments
 (0)