From dfc18c7bb9ab42edc4c0f2168132a8090bb83cac Mon Sep 17 00:00:00 2001 From: Mateus Guerra Date: Wed, 24 Oct 2018 21:27:16 -0300 Subject: [PATCH 1/4] Solved - Two Strings - Python3 --- CONTRIBUTORS.md | 1 + algorithms/strings/two_strings.py | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 algorithms/strings/two_strings.py diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 50e5f0e..d1f59b7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -17,3 +17,4 @@ Every name is sorted in alphabetically. - [shaurya uppal](https://github.com/shauryauppal) - [Ubamba98](https://github.com/ubamba98) - [vinayak42](https://github.com/vinayak42) +- [mateusguerra](https://github.com/mateusguerra) 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() From 3f83060cb110909c81db14f120ff2caf5083a45c Mon Sep 17 00:00:00 2001 From: Mateus Guerra Date: Wed, 24 Oct 2018 21:31:12 -0300 Subject: [PATCH 2/4] Added Two Strings in python to the Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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** From 818f12b682e633900806d07132278075dec8ea74 Mon Sep 17 00:00:00 2001 From: Mateus Guerra Date: Thu, 25 Oct 2018 21:52:03 -0300 Subject: [PATCH 3/4] Now in alphabetical order --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d1f59b7..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) @@ -17,4 +18,3 @@ Every name is sorted in alphabetically. - [shaurya uppal](https://github.com/shauryauppal) - [Ubamba98](https://github.com/ubamba98) - [vinayak42](https://github.com/vinayak42) -- [mateusguerra](https://github.com/mateusguerra) From a24b05a5ea98d388de5cda9888ef04060a2c3800 Mon Sep 17 00:00:00 2001 From: Mateus Guerra Date: Sun, 28 Oct 2018 22:50:10 -0300 Subject: [PATCH 4/4] Solved - Left Rotation - PHP --- data_structures/arrays/left_rotation.php | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 data_structures/arrays/left_rotation.php 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 @@ +