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.
omg.. it seems I've forgotten how to read. >.<
but still, just for the record, there have been some very rare football games that have ridiculously high goal counts. https://www.goalprofits.com/most-goals-scored-in-a-football-match/
it does say that "our team always plays 10 matches in the championship", but I don't see anything in the notes that specify the maximum number of goals any team could have in a match..
random tip, I tend to read these like a sentence.. so
0 <= x <= 4
would read as:0
is "less than or equal to"x
andx
is "less than or equal to"4
.just FYI: I know getting more than 9 goals in football is ridiculously rare, but it has happened (Google it). edge cases are not rare in programming, and this solution will break if either team scored more than 9...
with that said, I'm actually surprised that this challenge didn't throw in a random
"11:9"
score for that very reason. O.oThis comment is hidden because it contains spoiler information about the solution
that was an awesome challenge, thank you!
I ended up with a Dart 2.14 solution that completed the "basic tests" in 36ms, the "small random tests" in 101ms, and the "large random tests" in 97ms.. I think that's pretty decent, considering I'm still learning Dart. (:
FULL DISCLAIMER: I'm still learning Dart, so I'm open to any and all constructive criticism..
for what it's worth, the final test run before a submitted completed the "basic tests" in 36ms, the "small random tests" in 101ms, and the "large random tests" in 97ms.. that seems pretty decent to me. (:
(edit) while looking through other solutions, I had a completely random thought... why does it seem that everyone only uses
fold
to sum a list of things?? just like JS'sreduce
, it's SO much more powerful than people give it credit for.This comment is hidden because it contains spoiler information about the solution
that's so beautifully succinct... nicely done! (:
FWIW: some of the random tests on this Kata made it fun to read the output logging... (: saw a couple that went over a 1000 years. lol.
fold
ing into aString
.. (: well that's a nifty idea.hello, good people.. (:
I wanted to stretch my "developer legs" a little here and try something new.. I've been playing Sudoku both on paper and touch screen for many years, always enjoyed pattern-based puzzles, and I've been using JS since before jQuery was a thing.. but I've never tried anything quite like this before. so when I found this one, I just couldn't resist the urge to try... the "3kyu" difficulty rating only made me more determined to solve it.
in the interest of learning more and improving my skills, I would very much appreciate any constructive criticism of the solution I did come up with, if you (whoever is reading this) have a few minutes to spare..?
a little extra details, just for context. the only online research I did while working on this, was purely for JS API methods that were compatible with the Node 10 environment.. suffice to say, NodeJS itself has had many updates since then.
I didn't write the actual code here on Codewars, simply because the web UI makes life incredibly difficult on a smaller (
1366x768
) laptop screen.. so I did make use of VSCode, along with a "run wrapper" to handle puzzle selection and running the actual solution code.with that said, I used the 1 example test provided with this Kata and 4 of the 5 difficulty levels from my favourite Sudoku Android app (I'm leaving
fast
for later because it's a non-standard size, at6x6
cells in a2x3
block layout).. however, it could only solve theeasy
puzzle, hence the "try/catch
with asolution stuck
message.after posting my solution here, and having it pass this Kata's test cases, it was time for some research... I've since discovered new tricks that are even helping me with my phone-based sudoku games now, and realised that there is so much more that my solution here can do.
tl;dr: I'd like to break apart my current code before I try extend it any further. any and all thoughts and opinions are welcome!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
nice kata! :) feels like a good one for learning to balance "clever" and "readable" code... there are many steps that need to be done, but too many one-liners makes for very hard-to-read code.
Loading more items...