Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/assignment-java-2.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 116 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Challenge_1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import java.util.ArrayList;

class Main {
public static void main(String[] args) {
findPairs(new int[]{2, 4, 5, 1, 3, 5, 4}, 6);
System.out.println(isPalindrome("moddom"));
}

static void findPairs(int[] testArray, int targetSum) {
ArrayList<String> dups = new ArrayList<>();
for(int i = 0;i<testArray.length;i++){
for(int j = i+1;j<testArray.length;j++){
int max = Math.max(testArray[i],testArray[j]);
int min = Math.min(testArray[i],testArray[j]);
if(min+max == targetSum && !dups.contains(min+" "+max)){
dups.add(min+" "+max);
System.out.println("("+min+", "+max+")");
}
}
}
}

static boolean isPalindrome(String testString) {
String[] string = testString.split("");
for(int i = 0;i<Math.floor(string.length/2.0);i++){
System.out.println(string[i]+" "+string[string.length-i-1]);
if(!string[i].equals(string[string.length-i-1])){
return false;
}
}
return true;
}
}
14 changes: 14 additions & 0 deletions Challenge_2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
116 changes: 116 additions & 0 deletions Challenge_2/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Challenge_2/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions Challenge_2/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading