HackerRank Çözümleri – Two Strings

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 – Two Strings: https://www.hackerrank.com/challenges/two-strings/problem

► Problem açıklaması:

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


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


string: either YES or NO

0 thoughts on “HackerRank Çözümleri – Two Strings”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.