Skip to content

Commit

Permalink
Remove unused methods from JollyJumper
Browse files Browse the repository at this point in the history
  • Loading branch information
fatosmorina committed Apr 8, 2017
1 parent 266a084 commit b536d7e
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions UVa/JollyJumper.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/*A sequence of n > 0 integers is called a jolly jumper if the absolute values of the difference between
successive elements take on all the values 1 through n − 1. For instance,
1 4 2 3
Expand All @@ -16,7 +17,6 @@
Not jolly*/
//https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=979


import static java.lang.Integer.parseInt;
import static java.lang.System.exit;

Expand All @@ -32,7 +32,7 @@

public class JollyJumper {

static void solve() throws Exception {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while (input.hasNext()) {
Set<Integer> numbersAlreadyAdded = new HashSet<Integer>();
Expand All @@ -53,10 +53,9 @@ static void solve() throws Exception {
System.out.println("Not jolly");
}
}
input.close();
}

static int findMaximalElement(int[] numbers) {
public static int findMaximalElement(int[] numbers) {
int max = numbers[0];
for (int i = 1; i < numbers.length; i++) {
if (max < numbers[i]) {
Expand All @@ -66,31 +65,4 @@ static int findMaximalElement(int[] numbers) {
return max;
}

static int nextInt() throws IOException {
return parseInt(next());
}

static String next() throws IOException {
while (tok == null || !tok.hasMoreTokens()) {
tok = new StringTokenizer(in.readLine());
}
return tok.nextToken();
}

public static void main(String[] args) {
try {
in = new BufferedReader(new InputStreamReader(System.in));
out = new PrintWriter(new OutputStreamWriter(System.out));
solve();
in.close();
out.close();
} catch (Throwable e) {
e.printStackTrace();
exit(0);
}
}

static BufferedReader in;
static PrintWriter out;
static StringTokenizer tok;
}

0 comments on commit b536d7e

Please sign in to comment.