Joined April 2016
·
shinjukudev
Metaps
·
Tokyo
·
Posted to
Remove Element (JS Algorithm)
over 1 year
ago
@jeffcheung Thanks again for the great feedback. I learned a new way of working with reg-ex patterns from your example.
Yes, the return arr.length
was unintended. Fixed the typo now
Posted to
Vowel Count (JS Algorithm)
over 1 year
ago
@jeffcheung In that case, we can get rid of var count = 0
as well :)
Posted to
Vowel Count (JS Algorithm)
over 1 year
ago
@jeffcheung Hey! Thanks for the feedback! That's a really good point
I noticed that if the first integer in the array matches the integer to be removed, for instance:
The array will be returned as follows, with an empty string at index arr[0]:
This case is also different than expected:
returns:
I was expecting the returned array to equal
2,2,23333,2]
So I think this is simply a matter of a different interpretation of the problem.