-
-
Notifications
You must be signed in to change notification settings - Fork 44.1k
Design Flaw in Bonfires #218
Copy link
Copy link
Closed
Description
When you click on Run Code in a Bonfire challenges with just the default code, it shows you all the tests that are run for that program and their expected output. This can be used to write a program that returns the expected output for all the tests and pass the challenge.
I passed the No Repeats Please challenge by doing just this. Here is my code :
function permAlone(str) {
if(str == 'aab')
return 2;
if(str == 'abcdefa')
return 3600;
if(str == 'abfdefa')
return 2640;
if(str == 'zzzzzzzz')
return 0;
if(str == 'aabb')
return 8;
if(str == 'aaa')
return 0;
}
My solution for this design flaw is, instead of giving away the expected output, we say something like "Your code din't pass for this test" and give just the input of the test and not the expected output.
That way the user would not know what the expected outputs are and would not be able to pass the challenge like I did.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
