@Anush This means that the running time per output should not grow with the size of k or the size of the integers in I. That's impossible, because both affect the output size.
In accordance with our meta agreement to have a Language of the Month, and since the list of nominations had a single highest-voted entry at the beginning of May, we have a new featured language! Throughout May 2018, our Language of the Month, nominated by DJMcMayhem and Sanchises, will be:
M...
@EriktheOutgolfer I would prefer to have just the tag and a detailed explanation of what "code golf" means in the tag description. There's no need to re-state the same thing over and over again in all such challenges.
> Try to build ZAPM > Requires SDL_image-devel package > Install SDL_image-devel > Build fails for unrelated reasons > Give up > Try to remove now unneeded SDL_image-devel package > sudo dnf remove SDL* > Everything breaks as around 100 packages are removed
Says ncurses-compat-libs is already installed, but... ./zapm: error while loading shared libraries: libpanel.so.5: cannot open shared object file: No such file or directory
Orthodiagonal steps
It's a common problem to navigate in 2d matrix. We've seen it many times and will see again. So lets help future us and develope shortest solutions to generate all eight possible steps in 2d matrix.
Challenge
Your code takes no input.
Your code must output next 8 pairs of -...
Multidimensional orthodiagonal steps
Step further in step generation.
Navigation in 2d matrix is common, but something uncommon is even more insteresting.
Now I'll ask you to develope shortest solutions to generate all possible steps in N-dimensional matrix.
Challenge
Your code takes positive ...
I was confused whether to ask this question here or SO; as I am not looking for optimal solution/minimum bytes for this problem; instead have someone review my algorithm, which I am not sure where it goes wrong
With that said, I came across following problem on HackerRank
Devu likes to play wit...
@Pavel "If it stops getting security fixes, people will eventually move on." As someone who works in Corporate IT ... haha ... hahahahaha .... hahahahahahaha, oh that is funny. :D
At my work, we actually recently forked a Python 2 library into a private repo so we could make it actually support Python 3, which we migrated our whole stack to only a few months ago.
Input: An array I of k positive integers. The integers will be no larger than 100 and k <= 100.
Output: Your code must output all possible arrays O of non-negative integers of length k with the restriction that 0 <= O_i <= I_i. To get from one array to the next you may add or subtract 1 to one...
@Anush I still don't understand running time per new output. Shouldn't it just be running time? Also, are you sure there is an O(k) algorithm? (I don't know, I just fear it may be too restrictive)
so the number of output arrays is 2^k... if you wait until you have computed them all before outputting one, then it takes you 2^k * k time to output the first one
If I understand correcltly, you should say that you (1) require each output to be displayed on the fly, as opposed to on program exit, and (2) with O(k). I don't see how (1) is a consequence of anything @Anush
If I understand correcltly, you should say that you (1) require each output to be displayed on the fly, as opposed to on program exit, and (2) with O(k). I don't see how (1) is a consequence of anything @Anush
> Every new array should be output with time on the order of O(k) elapsing since the last result (or the start of the program for the first result). That is it should take time proportion to k and not, for example k^2 or 2^k. Note this is not the average time per output but the worst case time for each and every array outputted.
@EriktheOutgolfer @user202729 in relation to our conversation two hours ago, I've posted an answer in the hope of reversing the policy of re-explaining what code golf means in every code-golf challenge