Skip to content

Commit

Permalink
Added some discussion links
Browse files Browse the repository at this point in the history
  • Loading branch information
RodneyShag committed Nov 17, 2019
1 parent b2db949 commit 11dd8da
Show file tree
Hide file tree
Showing 21 changed files with 41 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Algorithms/Bit Manipulation/Maximizing XOR/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ static int maximizingXor(int L, int R) {
int result = (1 << (significantBit + 1)) - 1;
return result;
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/maximizing-xor/forum/comments/284317
2 changes: 2 additions & 0 deletions Algorithms/Bit Manipulation/Sansa and XOR/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ static int sansaXor(int[] array) {
return result;
}
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/sansa-and-xor/forum/comments/284330
2 changes: 2 additions & 0 deletions Algorithms/Bit Manipulation/Sum vs XOR/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ private static int numZeroes(long n) {
}
return count;
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/sum-vs-xor/forum/comments/284300
2 changes: 2 additions & 0 deletions Algorithms/Sorting/Counting Sort 2/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ static int[] countingSort(int[] givenArray) {
}
return sortedArray;
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/countingsort2/forum/comments/272970
2 changes: 2 additions & 0 deletions Algorithms/Strings/Caesar Cipher/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ private static char encrypt(char ch, int K) {
char base = Character.isLowerCase(ch) ? 'a' : 'A';
return (char) ((ch - base + K) % 26 + base);
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/caesar-cipher-1/forum/comments/269393
2 changes: 2 additions & 0 deletions Algorithms/Strings/Gemstones/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ static int gemstones(String[] array) {

return bitset.cardinality();
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/gem-stones/forum/comments/284428
2 changes: 2 additions & 0 deletions Algorithms/Strings/Super Reduced String/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ String superReducedString(String str) {
return sb.toString();
}
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/reduced-string/forum/comments/263979
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ private static int createFilledArray(String first, String second) {
return array;
}
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/ctci-making-anagrams/forum/comments/246741
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ public int find(String prefix) {
return curr.size;
}
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/ctci-contacts/forum/comments/246767
2 changes: 2 additions & 0 deletions Data Structures/Arrays/Algorithmic Crush/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ public static void main(String[] args) {
}

// Regarding the exact values of "a" and "b", it's a little tricky since "a" and "b" are 1-indexed but our array is 0-indexed. So we want to subtract 1 from both "a" and "b". However, for "b" we re-add 1 because we want to change values from "a" to "b" inclusive as stated in the problem, so we want the end of the interval to be 1 to the right of "b" which is why we re-add the 1.

// Discuss on HackerRank: https://www.hackerrank.com/challenges/crush/forum/comments/255515
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ static DoublyLinkedListNode sortedInsert(DoublyLinkedListNode head, int data) {
return head;
}
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/insert-a-node-into-a-sorted-doubly-linked-list/forum/comments/255744
2 changes: 2 additions & 0 deletions Data Structures/Linked Lists/Print in Reverse/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ void reversePrint(SinglyLinkedListNode n) {
System.out.println(n.data);
}
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/print-the-elements-of-a-linked-list-in-reverse/forum/comments/255098
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ DoublyLinkedListNode reverse(DoublyLinkedListNode head) {
}
return prev;
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/reverse-a-doubly-linked-list/forum/comments/255770
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ public static void main(String[] args) {
System.out.println(moneySpent);
}
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/electronics-shop/forum/comments/360045
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ static int findDigits(int num) {
}
return count;
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/find-digits/forum/comments/265470
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ static int minimumDistances(int[] array) {
}
return minDistance == Integer.MAX_VALUE ? -1 : minDistance;
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/minimum-distances/forum/comments/360084
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ public static int pickingNumbers(List<Integer> array) {
}
return max;
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/picking-numbers/forum/comments/362225
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ static long repeatedString(String str, long n) {

return totalAs;
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/repeated-string/forum/comments/266320
2 changes: 2 additions & 0 deletions Java/Data Structures/Java 1D Array (Part 2)/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ private static boolean isSolvable(int leap, int[] game, int i) {
|| isSolvable(leap, game, i + 1)
|| isSolvable(leap, game, i - 1);
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/java-1d-array/forum/comments/253767
2 changes: 2 additions & 0 deletions Java/Data Structures/Java Dequeue/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ public static void main(String[] args) {
System.out.println(max);
}
}

// Discuss on HackerRank: https://www.hackerrank.com/challenges/java-dequeue/forum/comments/254876
2 changes: 1 addition & 1 deletion Java/Strings/Java Regex 2 - Duplicate Words/Solution.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
m.group() is the entire match <br/>
m.group(i) is the ith match. So m.group(1) is the 1st match (which is enclosed in the 1st set of parentheses)
The ?: is added to make it a "non-capturing group", for slightly faster performance.
The ?: is added to make it a "non-capturing group" (meaning you can't do .group() to get the group), for slightly faster performance.
10/20/18 - Looks like the problem statement changed a bit, and digits should no longer be in the regular expression. User @4godspeed has an updated solution: https://www.hackerrank.com/challenges/duplicate-word/forum/comments/503715 that may work.
Expand Down

0 comments on commit 11dd8da

Please sign in to comment.