interactive-coding-challenges icon indicating copy to clipboard operation
interactive-coding-challenges copied to clipboard

Alternate flip_bit_challenge solution

Open bootandy opened this issue 7 years ago • 3 comments

This solution is clearer The space complexity is less (O(1)). It requires much less code

compared to previous merge this has: Algorithm description updated for new solution. Comments added to code

bootandy avatar Apr 19 '17 20:04 bootandy

I recommend do not delete the past algorithm. I think that is good have n-version to know different options.

eamanu avatar Apr 20 '17 13:04 eamanu

Ok, shall I open a pull request which creates a new file say: flip_bit_solution2.py ?

bootandy avatar Apr 21 '17 08:04 bootandy

I think that you can write the new algorithm in the flip_bit_solution.pywith a new subtitle, e.g. ''Algorithm 2: better flip bit algorithm".

Here, there are a sample: interactive-coding-challenges/arrays_strings/unique_chars/unique_chars_solution.ipynb

Anyway, we should wait to @donnemartin to know his opinion.

eamanu avatar Apr 21 '17 11:04 eamanu