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.
That may be the gist of the problem, but the problem states 'The string has a length greater or equal to one and contains only letters from a to z.' Adding extra error handling for other symbols and capital letters is not optimal as it's assumed this is already handled before the string is passed in.
Providing invalid characters to the input string is what the problem is all about
Great solution!
Nicely done
Why does a 3-line solution seem less clever to people than this?
that's pretty clever
great job!
had to do it manually to understand what you did haha good job!
That is my point, except that "N/A or an infinite number of years" in this case means an infinite loop, causing the application to freeze. This would not be best practices, as over 100 votes have claimed.
If invalid input is given to this method, it doesn't indicate it by either a returned value or an exception; instead, it just never returns at all.
That is what my question was trying to illuminate: if tax is not less than 1 or if interest is not greater than 0, what happens is a frozen application.
If tax is = 1 or more that means they're being taxed at 100% or more.
They will never meet the DesiredPrincipal and the answer is now N/A or an infinite number of years, because no matter how many years this man waits his initial value will never increase to meet the desired value
Similar answer to interest not being greater than 0, the answer is N/A or infinite number of years, as his initial value will never increase to hit the DesiredPrincipal value
This comment is hidden because it contains spoiler information about the solution
Nice!
How many string allocations on heap you have? I see 'n' allocations. I think this is too much for solve this simple task.
This comment is hidden because it contains spoiler information about the solution
hmm forgot this could be done with Linq.
Loading more items...