Hackerrank – Anagram

Problem Statement
A description of the problem can be found on Hackerrank.

Solution
Divide the input string into two halves. Count all common character in the halves. A result is difference between length of the one half and count of the common characters.

Different solution deletes common characters from the second half. The result is length of the second half after deletions.

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Ruby

Scala