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.
it is solution from chat gpt
Maybe its valuable to note that
out := ""
is the same as
var out string
which doesn't need to be initialized as the Zero Value of a String is by default ""
the data type is integer so 1.5 will change to 1 automatically
...except you still have to get the name's length, which is O(n) as well.
For example?
Depends on the situation and constraints
is fmt.Sprintf a good way to save a value?
xd wow
Bravo hh
You cam make a method static by the @staticmethod decorator.
Wow, guess I learned something new today! :D
I agree with you, if he adds a negative number to the array, the code will give an erroneous value
And here I am thinking there is no kind of creativity that could be expressed with such simple problem... lol
Amazing, that's out of the box.
the instructions say that "The numbers will also all be unique"
so you'll never get two of the same values, e.g. two '3's in your example
I do not think that this solution is correct.
It will overlook same-as items.
Try this variable with it.
numbers_list = [1, 2, 3, 3, 6, 7, 8, 9, 10, 12]
"3" would be the first non-consecutive item.
But the above function will choose "12"
The check should be whether it is consecutive (+1) or not.
Loading more items...