Hi, I'm the original author of this Kata (Ruby version). Author of the haskell version didn't understand this Kata properly, and indeed added a DFS version instead of BFS.
I have learned haskell to fix this. I added a BFS solution and a correct buildTree (thanks to @nickie for providing one). Please take a look again.
It isn't a set, but a sequence/list. The title "power set" is a little bit misleading. You need to return the set of all subsequences, not the set of all subsets, e.g.
-- 2nd zero 2nd zero-- v vpower [0,0] = [[], [0], [0], [0,0]]
-- ^ ^-- 1st zero 1st zero
Not an issue
Then how is [1,3] a subsequence of [1,2,3] as stated in the example?
Hi, I'm the original author of this Kata (Ruby version). Author of the haskell version didn't understand this Kata properly, and indeed added a DFS version instead of BFS.
I have learned haskell to fix this. I added a BFS solution and a correct buildTree (thanks to @nickie for providing one). Please take a look again.
Thanks,
Karol
It isn't a set, but a sequence/list. The title "power set" is a little bit misleading. You need to return the set of all subsequences, not the set of all subsets, e.g.
This has been reported several times, but the author isn't active anymore. See the issues by @muesli4, @karoyakani, @knotman90, @Thom and @pcapriotti.