Тёмный
No video :(

HackerRank - Palindrome Index 

Edvin He
Подписаться 580
Просмотров 4,6 тыс.
50% 1

Опубликовано:

 

22 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 8   
@Melcor2304
@Melcor2304 Год назад
Thanks! Your code helped me understand the logic of the question, along with how to apply other methods to it!
@CalebeMachado
@CalebeMachado 10 месяцев назад
I don't get it, maybe I'm making some confusion but for the given string = "aaabab", your algorithm is returning 5 (the index that should be removed), but this does not makes sense since the result of this would be "aaaba" and in reverse order "abaaa". So, this is not a palindrome... Besides that, all tests cases from HackerHank passes. What I'm missing? 🤔
@CalebeMachado
@CalebeMachado 10 месяцев назад
Maybe the problem is stating somehow that there is only one or none to be removed by the algorithm, well. I still did not get it.
@fernandoiglesiasg
@fernandoiglesiasg 7 месяцев назад
Instead of assigning indexToRemove to right directly in the else branch, I suspect it should be checked if the string from left to right-1 is a palindrome. If it is not (as in the test case in your comment), then indexToRemove should remain equal to -1. The loop can still break since the input cannot be made palindrome by removing only one character.
@mehmetalicopurlar7476
@mehmetalicopurlar7476 6 месяцев назад
I have the same result with you. Lets say the string is "abxca", the algorithm from video outputs as 3 which we remove third char it is abxa which is not a palindrome. hacker rank reports 100% which is not true. I think they should enrich the test cases @@CalebeMachado
@lovely_612
@lovely_612 2 года назад
Thank you
@streetjnoun
@streetjnoun 2 года назад
Thanks!
@GuilhermeOliveira-kr8vw
@GuilhermeOliveira-kr8vw 2 года назад
Hi man, I'm curious about something that happens to me with this challenge. Using your solution or another one of my design, all the tests pass. However, tests 12 and 13 fail if I solve this challenge in a mock test. Do you know why? Cheers.
Далее
HackerRank - Anagram
8:27
Просмотров 109
Hackerrank: Palindrome Index Problem
11:12
Просмотров 1,6 тыс.
СЛАДКОЕЖКИ ПОЙМУТ😁@andrey.grechka
00:11
HackerRank Solution: Palindrome Index in C++
5:08
Просмотров 3,6 тыс.
HackerRank - Gemstones
7:48
Просмотров 2,5 тыс.
Utopian tree
28:43
Просмотров 1 тыс.
Picking Numbers || Hackerrank Solution || Java || Hindi
13:24
HackerRank Luck Balance Solution Explained - Java
10:59
Palindrome Index | HackerRank (JavaScript)
7:17
HackerRank Java - Java Anagrams Solution Explained
11:00