• ###### prsmithcommented on "Reverse words" java solution

Big O notation is used to discuss how things grow as the dataset gets larger. It is not strictly limited to runtime, and is never in fact measuring runtime. It is simply a way of mathematically approximating how things grow.

It can be used to talk about the number of operations performed, number of comparisons used, memory required, memory allocations, etc. Its all in how you slice the code and determine what the most costly factors are. Whatever is most costly will generally have the biggest impact on runtime/performance.

In this case, memory allocations are the most costly part of the algorithm. And making 1 allocation, versus 3N + 1 allocations is the part that effects both the runtime and memory usage the most.

• ###### prsmithcommented on "Recursive reverse string" kata

@FArekkusu where can we find out why it was retired?

• ###### prsmithcommented on "Unlucky Days" javascript solution

Doing this math in milliseconds is a super bad idea, and completely unnecessary.

• ###### prsmithcommented on "Unlucky Days" javascript solution

You could have used lodash's range() method generate the months array and turn this into a one liner.

• ###### prsmithcommented on "Unlucky Days" javascript solution

Pretty efficient except for one line:
new Date(String(year))

This would be more efficient as:
new Date(year, 0)

• ###### prsmithcommented on "Unlucky Days" javascript solution

Mixing let and var is not "best practice".

• ###### prsmithcommented on "Unlucky Days" javascript solution

Mixing let and var is not "best practice".

• ###### prsmithcommented on "Artemas's Java solution for "Remove String Spaces"" kumite

Split/Join is significantly less efficient than replace.

• ###### prsmithcommented on "Vowel Count" java solution

Always use curly braces on if statements for readability and maintainability.

• ###### prsmithcommented on "Vowel Count" java solution

toCharArray() creates a copy of the string. You should always avoid this method.

• ###### prsmithcommented on "Calculate String Rotation" java solution

Do not use toCharArray(), it causes the string to be copied, where a copy is not necessary.

• ###### prsmithcommented on "Enumerable Magic #25 - Take the First N Elements" java solution

n >= arr.length

• ###### prsmithcommented on "Anagram Detection" java solution

Doesn't work for all test cases.

• ###### prsmithcreated an issue for "Remove duplicate words" kata

Needs a test case where some words are a substring of previous words.

Example: "starborn star"

• ###### prsmithcommented on "Remove duplicate words" java solution

Fails for case "starborn star"