Тёмный
No video :(

HackerRank C++ Solution: XOR Strings 

nexTRIE
Подписаться 6 тыс.
Просмотров 2,9 тыс.
50% 1

This video gives you the solution to the C++ debugging question called XOR Strings, from HackerRank. You will learn how to compare characters from two strings and determine if the XOR operation should output true or false. The solution here is to compare the characters at the same position in both strings.
Because C++ strings are also array of characters, we can access and compare each string's character using the array notation on the strings. You will also learn how to use the append() method on C++ strings. You will see that this HackerRank problem is similar to a bitwise problem.
All HackerRank solutions on GitHub (please leave a star): github.com/Isa...
HackerRank XOR Strings coding problem: www.hackerrank...

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

 

22 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@dipeshjha3528
@dipeshjha3528 3 года назад
Wowwwww It was much simple
@nextrie
@nextrie 3 года назад
Thanks Dipesh. Simplicity is very often the key to approach problems :)
@rupachandu5870
@rupachandu5870 2 года назад
Thank u. But I have a doubt, why u have given s.size() in for loop. What in case if we have second(t) string is larger than first (t)string. Loop will check until first string size only.
@nextrie
@nextrie 2 года назад
Hi Rupa, you do not need to worry about that because the constraints of this problem state that the absolute size value of both strings is the same. So, only strings of equal size will be passed to the function when the code is tested. Besides, the implementation of the for loop is provided already, when you start this challenge. So, you only need to debug it. Hope this helps.
Далее
HackerRank Solution: Counting Valleys in C++
3:44
Просмотров 2,8 тыс.
HackerRank Solution: Palindrome Index in C++
5:08
Просмотров 3,6 тыс.
HackerRank Solution: Service Lane in C++
10:35
Просмотров 1,9 тыс.
HackerRank Solution: Super Reduced String in C++
2:50
Просмотров 2,8 тыс.
HackerRank Solution: Cut the Sticks in C++
7:42
Просмотров 2,8 тыс.
Permuting Two Arrays - Hackerrank Problem
7:20
Просмотров 2 тыс.
HackerRank Solution: Mars Exploration in C++
8:54
Просмотров 1,8 тыс.