File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
algorithms/implementation/divisible-sum-pairs Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 34
34
| 10 | Warmup | [ Birthday Cake Candles] ( https://www.hackerrank.com/challenges/birthday-cake-candles ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/warmup/birthday-cake-candles/birthday-cake-candles.js ) | Easy | 10 |
35
35
| 11 | Implementation | [ Grading Students] ( https://www.hackerrank.com/challenges/grading ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/implementation/grading-students/grading-students.js ) | Easy | 10 |
36
36
| 12 | Implementation | [ Apple and Orange] ( https://www.hackerrank.com/challenges/apple-and-orange ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/implementation/apple-and-orange/count-apples-and-oranges.js ) | Easy | 10 |
37
- | 13 | Implementation | [ Between Two Sets ] ( https://www.hackerrank.com/challenges/between-two-sets ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/implementation/between-two-sets/get-total-x .js ) | Easy | 10 |
38
- | 14 | Implementation | [ Number Line Jumps ] ( https://www.hackerrank.com/challenges/number-line-jumps ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/implementation/number-line-jumps/kangaroo .js ) | Easy | 10 |
37
+ | 13 | Implementation | [ Number Line Jumps ] ( https://www.hackerrank.com/challenges/number-line-jumps ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/implementation/number-line-jumps/kangaroo .js ) | Easy | 10 |
38
+ | 14 | Implementation | [ Between Two Sets ] ( https://www.hackerrank.com/challenges/between-two-sets ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/implementation/between-two-sets/get-total-x .js ) | Easy | 10 |
39
39
| 15 | Implementation | [ Subarray Division] ( https://www.hackerrank.com/challenges/the-birthday-bar ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/implementation/subarray-division/birthday.js ) | Easy | 10 |
40
+ | 16 | Implementation | [ Divisible Sum Pairs] ( https://www.hackerrank.com/challenges/divisible-sum-pairs ) | [ Solution] ( https://github.com/algorodev/hackerrank-challenges/blob/master/algorithms/implementation/divisible-sum-pairs/divisible-sum-pairs.js ) | Easy | 10 |
40
41
41
42
## Data Structures
42
43
Original file line number Diff line number Diff line change
1
+ const divisibleSumPairs = ( n , k , ar ) => {
2
+ let count = 0
3
+
4
+ for ( let i = 0 ; i < ar . length ; i ++ ) {
5
+ for ( let j = 0 ; j < n ; j ++ ) {
6
+ if ( i < j && ( ar [ i ] + ar [ j ] ) % k === 0 ) {
7
+ count ++
8
+ }
9
+ }
10
+ }
11
+
12
+ return count
13
+ }
You can’t perform that action at this time.
0 commit comments