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.
Thanks for the advice ^_^
That is part of the trap of this problem: When you start raising numbers to exponents they can get really big really. If you have a big number (exponent of 7 or 8) and there are a couple of 9's in there you might get a result larger than an int can hold. If only there was an integer type that could hold something longer than a regular int could hold......
The way you determine your return value is redundant: "if true return true else return false". You can simplify that by just returning the result of the comparison (result == value).
I tend to agree with some of the other comments: this solution works for small arr arrays. As the length of arr increases this would become much less efficient (I think O(n^2)?). The other solutions are using a dictionary to overcome this possible bottleneck, since a dictionary is implemented as a hash table.
Good solution overall though. The counting of the occurrences is the only thing I would change.
Good Kata! As for the C# solution it would be nice if the starting template included "using System.Collections.Generic;" Not a terribly difficult thing to overcome, but it makes sense to me that the solution template would compile by default.
I agree - returning an empty list (at least in C# and apparently Java) makes the solution much more compact/elegant. I think it could be argued that you should just return a single element list with the length/width as a member.