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.
On this page of the site you can watch the video online Sherlock and the Valid String | HackerRank (Python) with a duration of hours minute second in good quality, which was uploaded by the user Glitched Failure 21 June 2021, share the link with friends and acquaintances, this video has already been watched 239 times on youtube and it was liked by 3 viewers. Enjoy your viewing!