I appeared for LinkedIn hackerrank test. There were 5 questions -
2 - Coding
2 - SQL
1 - Stat MCQ
One of the coding questions was as Finding Distinct Generators -
There is one integer number say 125. We need to find all the series of numbers whose sum is 125.
Eg. - int = 125
62 + 63
23 + 24+ 25+ 26+ 27
8+ 9+ 10+ 11+ 12+ 13+ 14+ 15+ 16+ 17
125
So the output is 4.
One more example -
say int = 5
Output is 2.
Now, I am not sure which algorithm needs to be used here.
Can anyone help me how we can code this in python?
def dist_generator(s -> Int):