Yes, you are right. Since Python 3.12, type is a soft keyword. Overwriting soft keywords within a scope is bad practice. However, when I wrote this code, type wasn't a soft keyword. That's a typical problem with legacy code. :)
Its allways better to check like
if(name == null) throw new IllegalArgumentException("name must not be null");
even if the description says that only valid strings appear
I think this is a good solution, but there are two points to improve it.
First you can use the variable head instead of currentNode for better readability and secondly if currentNode.data is null you will get an NullPointerExceptioin because you used rightly equals(). So you have to check if currentNode.data is not not null and continue the loop if data is null.
I think this solution is good, because it's returns the origin List instead of a new List. It's not totally clear whether to return a new list or the original one.
Yes, you are right. Since Python 3.12,
type
is a soft keyword. Overwriting soft keywords within a scope is bad practice. However, when I wrote this code,type
wasn't a soft keyword. That's a typical problem with legacy code. :)There's already a callable named
type
Perfectly balanced, as all things should be.
what are you doing bro
Will this looping over method works for all kinds of user defined functions??
If it works, it would be so great
Thanks in advance..
Its allways better to check like
if(name == null) throw new IllegalArgumentException("name must not be null");
even if the description says that only valid strings appear
You can use Math.abs(value) for the absolute value.
This comment is hidden because it contains spoiler information about the solution
I think this is a good solution, but there are two points to improve it.
First you can use the variable head instead of currentNode for better readability and secondly if currentNode.data is null you will get an NullPointerExceptioin because you used rightly equals(). So you have to check if currentNode.data is not not null and continue the loop if data is null.
This comment is hidden because it contains spoiler information about the solution
it's spelled Qatar
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
When you get paid for lines of code ....
I think this solution is good, because it's returns the origin List instead of a new List. It's not totally clear whether to return a new list or the original one.
Loading more items...