you are a genius!
I tried something like this, but this created problems as I used comparisons with float and double variables. But then the fact that āit is the second question of the contest with so many submissionsā, I just thought the only thing that I am not given any decimal precision value. It can be any number of digits after decimal and thus Iāll be able to make 100 if possible as per the sum. So, I thought the below thing(my answer below).
I implemented the exact same thing. Kudos!
this should be the easiest method
the logic is so straight forward, if an element is zero you cannot convert into any A element because, then it would be rounded to next number, therefore just neglect the zero element and then just sum the rest and divide the extra score among the numbers and if could be divided then, A array is possible else notā¦
I was curious to see your question today. Hope this will answer your question.
11 * 10 = 110
10 / 11 = 0.90909090909
10 - 0.90909090909 = 9.09090909091
9.09090909091 * 11 = 10011 * 10 = 110
10 / 11 = 0.90909090909
10 - 0.90909090909 = 9.09090909091
9.09090909091 * 11 = 100