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.
Super explanation, thank you for this - I was going slightly mad.
I solved using a for loop 😆
This comment is hidden because it contains spoiler information about the solution
You sure? this is a 8kyu quiz? i try to solve like two sum...
I guess i'm over thinking
%%
is one of many Parameter Substitution Operators in BASH.Source: https://tldp.org/LDP/abs/html/parameter-substitution.html
For context, here are my own practical descriptions of
%%
,%
,##
, and#
. I actually use these at the command line pretty often. Check out the source for definitive descriptions, as well as numerous examples.${a%%b*}
Remove the end of$a
, from right to left, ending on the leftmost pattern that starts with"b"
${a%b*}
Remove the end of$a
, from right to left, ending on the rightmost pattern that starts with"b"
${a##*b}
Remove the beginning of$a
, from left to right, ending on the rightmost pattern that ends in"b"
${a#*b}
Remove the beginning of$a
, from left to right, ending on the leftmost pattern that ends in"b"
Tips for remembering:
On a standard US keyboard,
#
is to the left of%
. Equivalently,%
is to the right of#
. This should help you remember which key to use.One
#
or%
means non-greedy, whereas two means greedy. Two is more than one, which should help you remember##
and%%
are greedy matches.Hi, how/why does absolute work for all use cases?
This comment is hidden because it contains spoiler information about the solution
PEMDAS
I have a poor understanding of math. What is the significance of the - 2 ?
nice
This comment is hidden because it contains spoiler information about the solution
I think that is a very smart way to solve it. A function Math.abs() is really usefull here)
Never know about this method
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...