Hackerrank – Divisible Sum Pairs

Hackerrank – Problem Statement

A description of the problem can be found on Hackerrank.

Solution

Create index pairs variations for all indexes that pair is unique – it means when (i, j) exists (j, i) is the same. For each pair calculate the sum of values at corresponding index. If is divisible, count them and print

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Scala

Ruby

Leave a Reply

Your email address will not be published. Required fields are marked *