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.
Not an issue -->
Range for the random tests: 1000 <= n <= 200000
From PostgreSQL 14 documentation, 7.2.5:
Currently, window functions always require presorted data, and so the query output will be ordered according to one or another of the window functions' PARTITION BY/ORDER BY clauses. It is not recommended to rely on this, however. Use an explicit top-level ORDER BY clause if you want to be sure the results are sorted in a particular way.
https://www.postgresql.org/docs/14/queries-table-expressions.html
True, but that seems more of a problem with the Title method which is supposed to capitalize every word. I agree that it should be clarified in the description or the test cases if that's not OK.
https://oeis.org/A083876
What's interesting is that when I tried your solution, it timed out roughly half of the time. When it didn't time out, it passed the test suite in around 6 seconds. Is this a server fault or 'unlucky' test cases?
Same problem happened to me. Took 3 tries to pass the test using ROUND(numeric, int)::float
@raimiss8 I disagree with you. I recommend reading an article about it, written by Jon Skeet (a C# expert): http://jonskeet.uk/csharp/stringbuilder.html
And in JS, you don't want to implement a stack object from scratch anyway; just use arrays like any normal people do. It's also faster because you don't have to deal with bottlenecks handling objects (built-in in Python and JS are fast).
I don't think so, unless you're adding it as a secondary ORDER BY
And Arphox I think your solution is not that good to :) string builder is good choise only if strings are big or is many of them like milion or so. In this case Concat or string join something like this or even aggregate is better choise when building small string.
Yes this solution is not the best performance wise its jus simple one :)
No it isn't. This one literally iterates through the string 6 times which is waste of CPU. Check my solution for a fast one (maybe the fastest).
Added that test to all languages. Marking your post as a Suggestion next time is a good idea.
This comment is hidden because it contains spoiler information about the solution
Sorry I accidentally flagged the above comment because it is hidden and I thought I was expanding it to see what it said.
Loading more items...