Skip to main content

All Questions

8 votes
5 answers
2k views

Repeatedly partitioning an array equally as far as possible

I solved HackerRank Nikita and the Game. The implementation is correct as program passes all test cases. Nikita just came up with a new array game. The rules are as follows: Initially, ...
Jasdeep Singh Chhabra's user avatar
4 votes
2 answers
6k views

Finding all the subsets in an array of integers that sum to a given target

Problem Statement: Given an Array if ints, Find out all the subsets in the Array that sum to a given target value. Example: If the input array is: ...
Anirudh's user avatar
  • 872
3 votes
1 answer
442 views

Find the maximum possible summation of differences of consecutive elements

Array A contains the elements, \$A_1,A_2, \ldots, A_N\$. And array B contains the elements, \$B_1,B_2, \ldots, B_N\$. There is a relationship between \$A_i\$ and \$B_i\$: any element \$A_i\$ ...
kumarmo2's user avatar
  • 261
3 votes
1 answer
4k views

Count the number of distinct subarrays

I want to determine the number of distinct subarrays that can form having at most a given number of odd elements. Two subarrays are distinct if they differ at even one position. The subarray is a ...
wagaga's user avatar
  • 31
1 vote
3 answers
133 views

Another ATMs cash-out (denomination) algorithm in Java

Related to this question and this answer, I would like to have a second review from you on a modified version. The problem I tried to solve Some kind of "Minimum count of numbers required from ...
Tobias Grothe's user avatar