5 kyu
Count The Hits Adding Contiguous Powers!
Loading description...
Fundamentals
Mathematics
Permutations
Sorting
Logic
Strings
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
python new test frameworks
Approved!
Is there any reason
pow_
is limited to2
,3
and4
? This seems like a very important information.To me it does not look to be important info, unless you want to micro-optimise your solution. I do think the max amount of numbers of digs in the input, and max power should be stated in the description.
Hi Raul,
pow_
at the beginning of the description but you don't say that it's one of the inputs, for example.[9, 16] 25 True <--- hit (we don't count it, we had a hit at 25)
-> weird... we don't count it and we add a hit anyway? seems to me there is a contradiction here.cheers
This comment has been hidden.
This comment has been hidden.
sounds good enough. Either way, the task isn't easy to describe.
Hey! I am working on this kata as we speak and I think I may have ran into an error. The permutational list for the first example is [3, 5, 2] (dig_list)----> [2, 3, 5, 23, 25, 32, 35, 52, 53, 235, 253, 325, 352, 523, 532]
You asked for a combination of perfect powers of two that would be in this list but you only mentioned 5 and 25. I found that 324 + 1 is another combination. seeing as in
powL = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529]
there is indeed a sub array of 324 and 1
Thanks!
It's says to form sub-arrays of contiguous terms. 324 has 289 before and 361 after. 1 and 324 are not contiguous. Thanks for the feedback, and I'll be waiting your answer if you've got any doubt.
I'm interested in having a word from you when you solve it.
I've solved it, haven't solved the additional problems on submit however. Well, not in the speed it requires :( I'll have to get back to this
Perhaps operations with sets may fasten your code.