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.
Totally agree man, and well thanks for starting the initiative and giving lead on this one, helped a lot.
Some edge case tests are missing at least in Python:
This solution fails at:
but it passes all tests sometimes.
In my opinion description is a bit unclear and written in a way that is misleading / difficult to understand
Here's a simplified version of the task description:
"You have a string made up of the letters 'D', 'P', and 'C'. Your task is to find the smallest positive number, N, that satisfies certain rules based on the string. Here are the rules:
For each position in the string (let's call this position 'i'), do the following based on the character at that position:
Find the smallest number N that satisfies all the rules for the given string. If no such number exists, return -1. The number N should be less than or equal to 1 billion (1,000,000,000)."
Wouldn't it be better to add in the description that the correct answer for middlePyramid is 1074 not 1064? As many people thinks it's an issue it would laso be good to add some hints like that it is based on "Greedy algorithm" or that you should use dynamic programming technic to solve it? I understand that it is good practive to look for an answer however in order to catch a fish you need a fishing rod first.
This comment is hidden because it contains spoiler information about the solution
Don't look at it
I'm also getting a timeout error, cause of the large numbers.
if they have the same weight,ypu have to compare them according string ascii code
I googled basic java stuff bc I forgot a lot of stuff but nothing specifically related to the problem does that count 😂
I already admitted to mistake. There is no need to continue this topic.
@VaxiZ: with your reasoning, nothing's wrong with bogosort, which is, to say the least, arguable.
FWIW I have the complete opposite view; I think it's amazing to realise that mathematicians working hundreds of years ago with pen and paper (or even thousands of years ago using sticks in the sand like Euclid) could come up with "algorithms" that are faster than what a decent brute-force programmer can do with a modern computer -- if that isn't motivation to learn more from the "math" katas, I don't know what is!
Also, nothing wrong with Opel Astras >:(
Try harder. (Or less harder) The solution is easier than it seems.
The worst code I have ever written... I am proud of it
I glanced at the solutions and saw a top answer used
if (array[0].length == 0) { return new int[0]; }
which is a little simpler than what I tried
Loading more items...