HackerRank Çözümleri - Two Strings

Опубликовано: 10 Март 2026
на канале: Soner Gönül
2,144
36

HackerRank içerisinde bulunan "Two Strings" sorusunun açıklaması ve çözümü. Bu soruda size verilen iki adet string'in ortak bir substring'i olup olmadığı soruluyor. Bu arada substring'ler 1 karakter uzunluğunda da olabilir.

#hackerrank #programming #coding

► HackerRank - Two Strings: https://www.hackerrank.com/challenges...

0:00 | Intro
0:15 | Sorunun açıklaması
2:50 | Çözümün kodlanması
4:55 | Outro

► Problem açıklaması:

Given two strings, determine if they share a common substring. A substring may be as small as one character.

Example:

s1 = "and"
s2 = "art"

These share the common substring "a".

s1 = "be"
s2 = "cat"

These do not share a substring.

Function Description

Complete the function twoStrings in the editor below.

twoStrings has the following parameter(s):

string s1: a string
string s2: another string
Returns

string: either YES or NO

***

Sosyal Medya

► Twitter'dan takip edin:   / sonergonul  
► Twitch'ten takip edin:   / sonergonul  
► Discord kanalımız:   / discord  
► Quora'dan takip edin: https://www.quora.com/profile/Soner-G...

Destek

► ByNoGame: https://www.bynogame.com/destekle/son...
► Stremlabs: https://streamlabs.com/sonergonul/tip