This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
![Image description here](https://raw.githubusercontent.com/BharathKumarS/BharathKumarS/master/Bharath-Img_Intro.gif "Welcome to my GitHub") | |
## I'm an Aspiring Data Scientist with a strong analytical background, and 4+ years of experience using Data Engineering, Data Analytics, Data Science, and Agile Software Development skills, I build data-driven solutions. #The_Bharatha <br> | |
## I enjoy writing technical tutorial blog articles, Participating in Coding contests, Solving Python, and SQL challenges on LeetCode and HackerRank. <br> | |
> ## Python, SQL, Hadoop, Scala, GitHub, and AWS but not limited to are a few of my preferred tech stack to learn, explore, practice Machine Learning. <br> <br> | |
<table class='tg'> | |
<thead> | |
<tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function that gets a string as an parameter | |
def stringComprress(givenStr): | |
# Initializing an empty string, it hold the compressed string output from the loop | |
encoded = '' | |
# Assuming there is at least one character in the given string | |
charCount = 1 | |
# Looping through all the characters in the given string | |
# String with index 1 through the length of the given string | |
for char in range(1, len(givenStr)): | |
# Condition to check if the current string is same as previous string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def removeOuterParentheses(self, S): | |
result = '' | |
openB = closeB = start = 0 | |
for bracket in range(len(S)): | |
if S[bracket] == '(': | |
openB += 1 | |
else: | |
closeB += 1 | |
if openB == closeB: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def reverseString(self, s: List[str]) -> None: | |
s.reverse() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = 'PAAALLPALLLLLL' | |
reward = True | |
if s.count('A') > 1 or 'LLL' in s: | |
reward = False | |
print(reward) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arr = [17,18,5,4,6,1] | |
for num in range(len(arr)-1): | |
arr[num] = max(arr[num+1:]) | |
arr[len(arr)-1] = -1 | |
print(arr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def libraryFine(d1, m1, y1, d2, m2, y2): | |
if y1 > y2: | |
return(10000) | |
elif y1 == y2 and m1 > m2: | |
return(500 * (m1-m2)) | |
elif y1 == y2 and m1 == m2 and d1 > d2: | |
return(15 *abs(d1-d2)) | |
elif y1 <= y2 and m1 <= m2 and d1 <= d2: | |
return(0) | |
elif y1 == y2 and m1 < m2 and d1 > d2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def appendAndDelete(s, t, k): | |
given = list(s) | |
sLen = len(given) | |
target = list(t) | |
tLen = len(target) | |
ops = 0 | |
if sLen > tLen: | |
while sLen != 0: | |
try: | |
if given[sLen-1] == target[sLen-1]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pickingNumbers(a): | |
b = list() | |
tempSum = pairSum = 0 | |
a.sort(reverse=True) | |
c = sorted(set(a),reverse=True) | |
for sortNum in c: | |
b.append([a.count(sortNum), sortNum]) | |
b.sort(key= lambda x:x[1], reverse=True) | |
for left in b: | |
for right in b: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Score_board: | |
def board(self, scores, alice): | |
self.boardScores = sorted(set(scores), reverse=True) | |
alice_rank = list(map(self.rankBoard,alice)) | |
return alice_rank | |
def rankBoard(self, current): | |
score_bank = self.boardScores | |
midIndex = len(score_bank)//2 | |
while midIndex > 0: |
NewerOlder