Telegram Group & Telegram Channel
Solution:

def BalancedBrackets(st):
openingBrackets="([{"
closingBrackets=")]}"
matchingBrackets={ ')':'(',
'}':'{',
']':'[' }
stack=[]
for char in st:
if char in openingBrackets:
stack.append(char)
elif char in closingBrackets:
if len(stack)==0:
return False
if stack[-1]==matchingBrackets[char]:
stack.pop()
else:
return False
return len(stack)==0
print(BalancedBrackets(input()))

Share and Support @python_codes



tg-me.com/python_codes/129
Create:
Last Update:

Solution:

def BalancedBrackets(st):
openingBrackets="([{"
closingBrackets=")]}"
matchingBrackets={ ')':'(',
'}':'{',
']':'[' }
stack=[]
for char in st:
if char in openingBrackets:
stack.append(char)
elif char in closingBrackets:
if len(stack)==0:
return False
if stack[-1]==matchingBrackets[char]:
stack.pop()
else:
return False
return len(stack)==0
print(BalancedBrackets(input()))

Share and Support @python_codes

BY Python Codes


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_codes/129

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

Why Telegram?

Telegram has no known backdoors and, even though it is come in for criticism for using proprietary encryption methods instead of open-source ones, those have yet to be compromised. While no messaging app can guarantee a 100% impermeable defense against determined attackers, Telegram is vulnerabilities are few and either theoretical or based on spoof files fooling users into actively enabling an attack.

Telegram announces Anonymous Admins

The cloud-based messaging platform is also adding Anonymous Group Admins feature. As per Telegram, this feature is being introduced for safer protests. As per the Telegram blog post, users can “Toggle Remain Anonymous in Admin rights to enable Batman mode. The anonymized admin will be hidden in the list of group members, and their messages in the chat will be signed with the group name, similar to channel posts.”

Python Codes from us


Telegram Python Codes
FROM USA