CORRECTION: For the last check (10:38), the logic should also include a check that the count of counts for the LARGER number is 1. This is because we can only remove a character, not add one - so checking the absolute difference between the counts is not enough. For example, the string "aabbbcccddd" or {a:2, b:3, c:3, d:3} should be invalid. I've included this correction in my code (see link below).
CORRECTION: While the solution in the video passes all test cases, the logic could still be improved. Most notably for the case of "abb", which should return "YES". I've updated my solution to cover this case.
Challenge: https://www.hackerrank.com/challenges...
Code: https://gist.github.com/Shaddyjr/b0aa...
Intro: (0:00)
Solution: (1:21)
As a way to improve my coding skills and technical interview prep, I practice HackerRank, Code Wars, and Code Signal problems and solve them live with minimal edits. This allows viewers to see my thought process and problem-solving techniques along with the true struggles I go through when solving these technical coding problems. I also delve into tutorials about building out data structures, algorithms, and various other relevant and practical topics.
I mainly code in JavaScript, Python, and SQL. I also occasionally detour onto other challenges, like those from my own technical interviews, daily coding challenges, or just fun coding puzzles I come across.
Auf dieser Seite können Sie das Online-Video Sherlock and the Valid String | HackerRank (Python) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Glitched Failure 21 Juni 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 239 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!