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.
warning: noob here
given a VERY long unsorted array wouldn't it be better to actually sort it then set the for loop condition to numbers[i]<target ?
I tested your code and it returns wrong output for the input:
A man, a plan, a canal - Panama
(Returnsfalse
). You must remove all non-alphanumeric characters, including all symbols and spaces. This challenge lacks tests.Overcomplicated,
two sum
is a simple and basic problem; one could solve it with 5 lines of code.This comment is hidden because it contains spoiler information about the solution