diff --git a/JEOH/11to20/11.py b/JEOH/11to20/11.py new file mode 100644 index 0000000..25ceeb7 --- /dev/null +++ b/JEOH/11to20/11.py @@ -0,0 +1,14 @@ +def solution(s): + answer=0 + stack=[] + for i in s: + if stack and stack[-1]==i: + stack.pop() + else: + stack.append(i) + if stack: + answer=0 + else: + answer=1 + + return answer \ No newline at end of file diff --git a/JEOH/11to20/12.py b/JEOH/11to20/12.py new file mode 100644 index 0000000..e69de29 diff --git a/JEOH/1to10/10.py b/JEOH/1to10/10.py new file mode 100644 index 0000000..e69de29 diff --git a/JEOH/1to10/8.py b/JEOH/1to10/8.py new file mode 100644 index 0000000..907c06c --- /dev/null +++ b/JEOH/1to10/8.py @@ -0,0 +1,14 @@ +def solution(a): + stack=[] + for i in a: + if i=="(": + stack.append(i) + elif i==")": + if not stack: + return False + else: + stack.pop() + if stack: + return False + else: + return True diff --git a/JEOH/1to10/9.py b/JEOH/1to10/9.py new file mode 100644 index 0000000..d1d275f --- /dev/null +++ b/JEOH/1to10/9.py @@ -0,0 +1,10 @@ +def solution(num): + stack=[] + while num>1: + a=num%2 + num=num//2 + stack.append(str(a)) + stack.append(str(num)) + stack.reverse() + bin=''.join(stack) + return bin diff --git a/JEOH/81to90/81.py b/JEOH/81to90/81.py new file mode 100644 index 0000000..e69de29 diff --git a/JEOH/91to100/91.py b/JEOH/91to100/91.py new file mode 100644 index 0000000..e69de29 diff --git a/JEOH/91to100/92.py b/JEOH/91to100/92.py new file mode 100644 index 0000000..e69de29 diff --git a/JEOH/91to100/93.py b/JEOH/91to100/93.py new file mode 100644 index 0000000..e69de29 diff --git a/JEOH/91to100/94.py b/JEOH/91to100/94.py new file mode 100644 index 0000000..e69de29