From c5c13b914b3fe9745faf066dcbb302528b07cbc2 Mon Sep 17 00:00:00 2001 From: Owen Murphy Date: Thu, 15 Feb 2018 15:14:38 -0500 Subject: [PATCH] starting to tackle now --- .../looplabs/IntegerDuplicateDeleter.java | 30 +++++++++++++++++++ .../looplabs/StringDuplicateDeleter.java | 12 ++++---- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zipcodewilmington/looplabs/IntegerDuplicateDeleter.java b/src/main/java/com/zipcodewilmington/looplabs/IntegerDuplicateDeleter.java index ee550c5..21edaf3 100644 --- a/src/main/java/com/zipcodewilmington/looplabs/IntegerDuplicateDeleter.java +++ b/src/main/java/com/zipcodewilmington/looplabs/IntegerDuplicateDeleter.java @@ -2,7 +2,37 @@ /** * Created by leon on 1/29/18. + * * @ATTENTION_TO_STUDENTS You are forbidden from modifying the signature of this class. */ public final class IntegerDuplicateDeleter extends DuplicateDeleter { + public IntegerDuplicateDeleter(Integer[] intArray) { + super(intArray); + } + + @Override + public Integer[] removeDuplicates(int maxNumberOfDuplications) { + + + return new Integer[0]; + } + + @Override + public Integer[] removeDuplicatesExactly(int exactNumberOfDuplications) { + + + return null; + } + + protected Integer countNumberOfOccurences(Integer[] inputArray, Integer value) { + int counter = 0; + for (int i = 0; i < inputArray.length; i++) { + if (array[i].equals(value)) { + counter++; + } + + } + return counter; + } } + diff --git a/src/main/java/com/zipcodewilmington/looplabs/StringDuplicateDeleter.java b/src/main/java/com/zipcodewilmington/looplabs/StringDuplicateDeleter.java index 4818fe3..8f90535 100644 --- a/src/main/java/com/zipcodewilmington/looplabs/StringDuplicateDeleter.java +++ b/src/main/java/com/zipcodewilmington/looplabs/StringDuplicateDeleter.java @@ -1,8 +1,8 @@ package com.zipcodewilmington.looplabs; -/** - * Created by leon on 1/28/18. - * @ATTENTION_TO_STUDENTS You are forbidden from modifying the signature of this class. - */ -public final class StringDuplicateDeleter extends DuplicateDeleter { -} +///** +// * Created by leon on 1/28/18. +// * @ATTENTION_TO_STUDENTS You are forbidden from modifying the signature of this class. +// */ +//public final class StringDuplicateDeleter extends DuplicateDeleter { +//}