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.
Yah...This function will accept (xxx) xxx-xxxx as a valid phone number. Everyone says it's so clever! lol
See
https://junli.netlify.app/en/overlapping-regular-expression-in-python/
For a bit of an explanation as to how the lookahead is working and a link to a relevant Stack Overflow question.
thank you for your comment
thanks :)
...
is the spread operator(Spread syntax MDN article). You should google it to learn more.can i ask a question, i dont understend the three dots before list, can you tell what are those. thanks
This comment is hidden because it contains spoiler information about the solution
The formula needs () around the 5.14/W term or else the top could be interpreted as (A × 5.14)/(W × r)
Thank you! I have been using the + for a little while now because of you. I enjoy many of your Kata's as well. :)
Good Kata! However, I agree with Stranewayesthere is definitely a bit of an English problem with the instructions. You should definitely change the wording to mention that the length of the numbers to the left and right of the decimal point is what decides the correct function to use.
Glad you enjoyed - feel free to check out the others in the series :D
Good one! Thanks for the fun mate!
This:
should be:
because a[0] and a[1] are two string
Thanks! It is kind of ugly, but I am pretty new to all this and usually at the point where I just want to make a solution that works.
function convertToMixedNumeral(parm){
var a = parm.split('/');
var wNum = (a[0]>0)? Math.floor(a[0]/a[1]):Math.ceil(a[0]/a[1]); ;
var fNum = a[0]%a[1];
var ans = (wNum !==0)?
${wNum} ${fNum}/${a[1]}
:${fNum}/${a[1]}
;var ansNeg =
${wNum} ${-1*fNum}/${a[1]}
if( fNum == 0){
return
${wNum}
;} else if (a[0] < a[1] && a[0] > 0){
return parm;
} else if (wNum < 0){
return ansNeg;
}else return ans;
}
Can you please post your code and I will attempt to find out what's going on.
Please mark the reply as spoiler content.
Loading more items...