Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
But now the values are able to include
0.fixed
The description ends with: "Note: Assume that all values in the list are positive integer values > 0 and each value in the list is unique."
The C random tests give repeat values, and it caused my first solution, made with that assumption, to time out.
Please frame the question properly.
It makes us think that we have can't have a char in string more than twice!
Groovy translation
I think that the "repeated once" is a language trap. I can see how it can be ambiguous, especially for non-native speakers.
Why would you think that? The current test code is correct.
Edit: I see why you think that. Looking at your code, you've managed to do the task exactly backwards. You are supposed to take the input string and double each letter. You've written code which takes an input string and removes all double letters.
Incorrect Python test code
The correct code should be
@test.describe("Fixed Tests")
def fixed_tests():
@test.it('Basic Test Cases')
def basic_test_cases():
test.assert_equals(double_char("SSttrriinngg"),"String")
test.assert_equals(double_char("HHeelllloo WWoorrlldd"),"Helo World")
test.assert_equals(double_char("11223344!!__ "),"1234!_ ")
Click reset and try again, there is no problem with the tests unless you somehow edited them.
But the problem here is you renamed the method to
doubleCharsinstead ofdoubleCharand that's why the tests don't find it and throw that error.Issues in test code:
src/test/java/SolutionTest.java:8: error: cannot find symbol
assertEquals("SSttrriinngg",Solution.doubleChar("String"));
^
symbol: method doubleChar(String)
location: class Solution
src/test/java/SolutionTest.java:9: error: cannot find symbol
assertEquals("HHeelllloo WWoorrlldd",Solution.doubleChar("Hello World"));
^
symbol: method doubleChar(String)
location: class Solution
src/test/java/SolutionTest.java:10: error: cannot find symbol
assertEquals("11223344!!__ ",Solution.doubleChar("1234!_ "));
^
symbol: method doubleChar(String)
location: class Solution
3 errors
iis never incremented in your code , so you write todoubledforevermy code is all correct but i keep getting segsevs(11):invaild memory access error what to do ?
Lua translation
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...