You need to sign in or sign up before continuing.×
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.
This comment is hidden because it contains spoiler information about the solution
Good job on solving this problem. I am not the best at algorithms or big o notation but I would suggest in the future maybe thinking of ways to structure your data and how you plan on looping through it. I am not a wizard at Regex; so my thought process was to sort smileys between the ones that have a nose and the ones who do not then out of those have smileys that are "winking" in the begging half of the array and the ones that arent in the second half. This way when I am looping through the main arr I can control what array and which portion I am looping through in order to find the best potential match. This saves me from looping through the all possible matches each time to possible not find any. This allows me to return false if I dont come up with a match from my list of best potential matches and I only have to loop through <= 4 possible matches instead of all 12 for every element in the arr array. I hope that made sense please feel free to look at my solution if not.
if you are using js or ts java and want to debug your failed test you can add a console.log() or for java System.out.println(); statement and it will print the logs when you run attempt. Note: without adding a conditional you will get all the logs for the each test. Therefore, if you want to debug for a particular year I would recommend adding an if condition to print only the logs for year in question.