[Community puzzle] Number of letters in a number - Binary


#1

This topic is about the puzzle Number of letters in a number - Binary.

Feel free to send your feedback or ask some help here!


#3

Hello,
Cant pass the last validator... but i pass the last test.


#4

Nice idea. I like the little trick in the last test cases


#5

The little trick for the last one is indeed .... tricky to find !!
:joy:


#6

Interesting puzzle, I liked it. The test case names were a nice hint.


#7

JS generators are timing out on me for the last testcase :frowning: gotta find a way around I guess
/e: recursion also going too deep, darn it :frowning:


#8

I liked the puzzle, the last two cases make it interesting. To me it was helpful to look at the expected value.


#9

// numbers used in the last test are too big for js
// (which is poor problem design, common thing on CG)
// but it still works by pure luck
// (or rather, by poor test case design, common thing on CG)

// also, lacks interesting cases with alternating repeating patterns
// instead of immediately repeting ones
// i.e. loops of length more than 1
// i am dissapoint


#10

There are hints in the names of the testcases. Check them again and look at your optimizations


#11

I hope this is not considered as a spoiler, feel free to delete this comment.

It seems there are no interesting patterns, as far as I can see.

edit: one could invent a new language with letter count 3 and 7 (instead of 3 and 4) or use numbers with base 3. But I guess it's too late now.

edit2: deleted graph, as it spoils too much. The intension was to show, that the testcases are not poorly chosen, this was achieved.


#12

It's been taken out of the puzzle pre-validation, but in the author's reference code, 0 -> 4. (It got taken out precisely because of the ambiguity)


#13

Same thing! :confused:


#14

I found a solution, you shall check the types of your variables! :wink:


#15

+1 to check variable types. Especially in JS...
Had to port my solution to PHP (and pass) before figuring out what's wrong with my JS-solution :slight_smile:


#16

This puzzle is nuts. I found the pattern and solved the puzzle, But when submitting it tells me the last test is failing. Even though every single custom test returns the result as expected.


#17

There's a bug in the last one. I figured out the solution and did thorough testing and everything returns to the pattern. And all the tests pass. So something must be up.


#18

There is no bug, you just didn’t find the right pattern.


#19

You are so helpful , I think your pattern give the whole ans.


#20

Looking back at my old post: you are right. One still has to understand the meaning though. I deleted the graph (but I can't delete it from the post's history).


#21

Loved this puzzle, and especially the "trick" that appears at the end, and the smart hint in the test cases name. Lovely :slight_smile: