Skip to content

Commit

Permalink
Merge 36d829d into 845e48a
Browse files Browse the repository at this point in the history
  • Loading branch information
jaebradley committed Aug 22, 2017
2 parents 845e48a + 36d829d commit feb4e8c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# HackerRank Problems

* Alphabetical Character Weight Calculator
* A lowercase English letter's `1`-indexed distance from `a`
* For example, the weight of `b` is `2`
* [Implementation](https://github.com/jaebradley/hackerrank/blob/master/src/main/java/algorithms/implementations/AlphabeticalCharacterWeightCalculatorImpl.java)
* [HackerRank](https://www.hackerrank.com/challenges/weighted-uniform-string)
* [Balanced Array Sum Identifier](https://github.com/jaebradley/hackerrank/blob/master/codereview/balancedArraySumIdentifier.md)
* Given an array A of length n, determine if there exists an element in the array such that the sum of the elements on
its left is equal to the sum of the elements on its right.
* [Implementation](https://github.com/jaebradley/hackerrank/blob/b16a885baecb8fa6cd5bf25c608e8f489a091cc4/src/main/java/algorithms/implementations/BalancedArraySumIdentifier.java)
* [HackerRank](https://www.hackerrank.com/challenges/sherlock-and-array)
* [CodeReview](https://codereview.stackexchange.com/questions/173704/for-an-array-check-if-an-index-exists-where-the-sum-of-the-elements-to-the-left)
* [Beautiful Number Validator](https://github.com/jaebradley/hackerrank/blob/master/codereview/beautifulNumberValidator.md)
* A numeric string, `s`, is beautiful if it can be split into a sequence of two or more positive integers, `a1`, `a2`, `a3`, etc., satisfying the following conditions
* Each element in the sequence is one greater than the previous element
* No element contains a leading zero
* The sequence cannot be rearranged
* For example, `1234` (`1`, `2`, `3`, `4`), `91011` (`9`, `10`, `11`), `99100` (`99`, `100`) are all beautiful numbers
* [Implementation](https://github.com/jaebradley/hackerrank/blob/master/src/main/java/algorithms/implementations/BeautifulNumberValidatorImpl.java)
* [HackerRank](https://www.hackerrank.com/challenges/separate-the-numbers/problem)
* [CodeReview](https://codereview.stackexchange.com/questions/169679/beautiful-number-validator/169705#169705)
* [Minimum Absolute Difference Identifier](https://github.com/jaebradley/hackerrank/blob/master/codereview/minimumAbsoluteDifferenceIdentifier.md)
* Given an array of N integers, find and print the minimum absolute difference between any two elements in the array.
* [Implementation](https://github.com/jaebradley/hackerrank/blob/master/src/main/java/algorithms/implementations/MinimumAbsoluteDifferenceIdentifier.java)
* [HackerRank](https://www.hackerrank.com/challenges/minimum-absolute-difference-in-an-array)
* [Pair Difference Counter](https://github.com/jaebradley/hackerrank/blob/master/codereview/pairDifferenceCounter.md)
* Given `N` integers, count the number of pairs of integers whose difference is `K`
* [Implementation](https://github.com/jaebradley/hackerrank/blob/master/src/main/java/algorithms/implementations/PairDifferenceCounter.java)
* [HackerRank](https://www.hackerrank.com/challenges/pairs/problem)
* [Unordered Anagrammatic Pairs Counter](https://github.com/jaebradley/hackerrank/blob/master/codereview/unorderedAnagrammaticPairsCounter.md)
* In other words, find the number of unordered pairs of substrings of `S` that are anagrams of each other
* [Implementation](https://github.com/jaebradley/hackerrank/blob/master/src/main/java/algorithms/implementations/UnorderedAnagrammaticPairsCounterImpl.java)
* [HackerRank](https://www.hackerrank.com/challenges/sherlock-and-anagrams/problem)
* [CodeReview](https://codereview.stackexchange.com/questions/169768/unordered-substring-anagrammatic-pairs)
2 changes: 1 addition & 1 deletion codereview/beautifulNumberValidator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Instead of printing `YES` or `NO`, I just wanted to return a `boolean`.

## Implementation

<! -- language: lang-java -->
<!-- language: lang-java -->

public class BeautifulNumberValidator {
public static boolean isValidBeautifulNumber(String s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
/**
* https://www.hackerrank.com/challenges/separate-the-numbers/problem
* https://codereview.stackexchange.com/questions/169679/beautiful-number-validator/169705#169705
*
* A numeric string, `s`, is beautiful if it can be split into a sequence of two or more positive integers, `a1`, `a2`, `a3`, etc., satisfying the following conditions
*
* Each element in the sequence is one greater than the previous element
* No element contains a leading zero
* The sequence cannot be rearranged
*
* For example, `1234` (`1`, `2`, `3`, `4`), `91011` (`9`, `10`, `11`), `99100` (`99`, `100`) are all beautiful numbers
*/

public class BeautifulNumberValidatorImpl implements BeautifulNumberValidator {
Expand Down

0 comments on commit feb4e8c

Please sign in to comment.