diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 50e5f0e..86d8ac2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -8,6 +8,7 @@ Every name is sorted in alphabetically. - [danhenriquesc](https://github.com/danhenriquesc) - [hundredrab](https://github.com/hundredrab) - [jackey8616](https://github.com/jackey8616) +- [mateusguerra](https://github.com/mateusguerra) - [mirianashvili](https://github.com/mirianashvili) - [Obsinqsob01](https://github.com/Obsinqsob01) - [PyPatel](https://github.com/PyPatel) diff --git a/README.md b/README.md index 13dd444..dacdf77 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ https://www.hackerrank.com/contests/code-and-the-curious/challenges | Alternating Characters | ✓ | | | | String Construction | | | ✓ | | Ashton and String | | ✓ | | -| Two Strings | | | ✓ | +| Two Strings | ✓ | | ✓ | **Sorting** diff --git a/algorithms/strings/two_strings.py b/algorithms/strings/two_strings.py new file mode 100644 index 0000000..68e50c0 --- /dev/null +++ b/algorithms/strings/two_strings.py @@ -0,0 +1,27 @@ +#!/bin/python3 + +import os + +# Complete the twoStrings function below. +def twoStrings(s1, s2): + intersection = set(s1) & set(s2) + if len(intersection) > 0: + return "YES" + return "NO" + + +if __name__ == '__main__': + fptr = open(os.environ['OUTPUT_PATH'], 'w') + + q = int(input()) + + for q_itr in range(q): + s1 = input() + + s2 = input() + + result = twoStrings(s1, s2) + + fptr.write(result + '\n') + + fptr.close() diff --git a/data_structures/arrays/left_rotation.php b/data_structures/arrays/left_rotation.php new file mode 100644 index 0000000..7d27c80 --- /dev/null +++ b/data_structures/arrays/left_rotation.php @@ -0,0 +1,29 @@ +