LeetCode License Key Formatting Solution Explained - Java

  Рет қаралды 5,968

Nick White

Nick White

Күн бұрын

Пікірлер: 8
@ankitagarwal4914
@ankitagarwal4914 4 жыл бұрын
Thanks Nick, I am grateful that I landed on your video series, all the explanations are very helpful.
@pubamx
@pubamx 4 жыл бұрын
This is an amazing explanation. I love your videos because I understand smoothly. Thanks Nick!
@otifelix
@otifelix 4 жыл бұрын
best explanation so far
@Rob-J-BJJ
@Rob-J-BJJ Жыл бұрын
wow so simple yet so powerful
@dfnkt
@dfnkt 5 жыл бұрын
I did this one again in JS and had it passing. I decided to refactor it in a silly way by using a bunch of built-in methods and on my 4th execution it gave me a failure when I apparently pulled the test case where S was "___" and K was 3, it was expecting the output to be "" (empty string) when I returned "___". A test case of "___" seems to violate the number two note "String S consists only of alphanumerical characters(a-z and/or A-Z and/or 0-9) and dashes(-)". i.imgur.com/XZZJBqK.png Ignore the code here where I was just goofing off. The regex used in this case would be equal to "___".match(/.{1,3}/g); which chunks the string into a 1 element array where the sole element is a K length string.
@dfnkt
@dfnkt 5 жыл бұрын
Edit: The failing test case ended up being three dashes, I had to paste it out into an editor to see the difference. I fixed the offending case.
@abishekkachroo938
@abishekkachroo938 5 жыл бұрын
But shouldn't be there any checking that if there is possibility of having these much groups ?
@madanmohanpachouly6135
@madanmohanpachouly6135 2 жыл бұрын
nice work
LeetCode Buddy Strings Solution Explained - Java
9:21
Nick White
Рет қаралды 10 М.
License Key Formatting
9:33
Kevin Naughton Jr.
Рет қаралды 16 М.
LeetCode Verifying an Alien Dictionary Solution Explained - Java
11:17
LeetCode Most Common Word Solution Explained - Java
8:21
Nick White
Рет қаралды 10 М.
Next Closest Time
8:47
Kevin Naughton Jr.
Рет қаралды 32 М.
LeetCode 290. Word Pattern Solution Explained - Java
8:58
Nick White
Рет қаралды 15 М.
Coding Interviews Be Like
5:31
Nicholas T.
Рет қаралды 6 МЛН
How I Mastered Data Structures and Algorithms in 8 Weeks
15:46
Aman Manazir
Рет қаралды 123 М.
LeetCode Longest Palindrome Solution Explained - Java
9:18
Nick White
Рет қаралды 30 М.
My Brain after 569 Leetcode Problems
7:50
NeetCode
Рет қаралды 2,7 МЛН
Top 7 Algorithms for Coding Interviews Explained SIMPLY
21:22
Codebagel
Рет қаралды 452 М.