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.
OOOOH THATS SO USEFUL THANKS A LOT!
Python list slicing works like this:
list[start:stop:step]
Where
start
is the first index to visit,stop
is the index before which we will stop, andstep
is how far to move at each step of the process.When
start
isn't specified it defaults to 0, and whenstop
isn't specified it means we take the entire list afterstart
. Whenstep
isn't specified it also defaults to 1.Putting this all together,
list[::-1]
means "take the entire list, stepping backwards" - or, in simpler terms, reverse it!Super Cool Solution! I haven't seen that "[::-1]" thing before can someone explain what that is plz?
The difference is that with the reversed method you get a result that you still need to convert to something so you can use it later on in the code. With the ::-1 method you get a final result that is ready to be used in your code, with this method you get a final result, with the reversed you get a tool to use.
Get ahead with the times, people! /j
While it's true that many composers use enharmonic equivalents for readability or to simplify transposition, there are cases where composers prioritize the functional role of chords and notes within the scale or harmonic context. In such instances, flats and sharps can coexist in the same score, and even double flats or double sharps may appear instead of their enharmonic equivalents. This approach ensures that the notation reflects the theoretical structure of the music, such as voice leading, chord functions, or adherence to a specific scale.
For example:
So while readability is often a priority, there are musical contexts where strict adherence to theory takes precedence. It's fascinating how notation choices can vary depending on the composer's intent and the piece's complexity!
If I understand the concerns raised by users below, the main issues are:
The problem is that I am not familiar enough with the domain of music to know how much of a problem it is if the above "usually" are violated in a coding challenge :)
Separating sharps from flats in inputs, if done, should not be a problem because this does not affect solutions.
Forcing flats-to-flats and sharps-to-sharps would break solutions, but I would personally not worry much about this TBH. I think it adds an interesting twist, still in scope of the rank, and new solutions will appear quickly. I am not a fan of beding backwards too hard only to keep old solutions, if invalidating them would allow improvements in quality.
Suggestion: add combination of flats and sharps in input, and add additional input arg to expect output in either flats or sharps. Make that param optional for backward compatibility of existing solutions (if backward compatibility is even possible).
Yes I planned to add C# I was just trying to figure the extent to which I want to modify this kata to address domain issues reported below (I.e. sharps vs flats in inputs and outputs).
no issue
I would keep the issue open. It is not clear from description whether an "interval" goes up or down.
EDIT: nevermind, the description states it:
This kata was decided to stay.
This comment is hidden because it contains spoiler information about the solution
Enabled in this fork
Loading more items...