Can any one explain for [problem:2003C], why PyPy3-64 is being slower here [submission:278391142] and getting TLE and also the memory limit, when the same code works fine with Python3 here [submission:278391153]. Thought PyPy always works faster than Python, what am I missing?↵
↵
![ ](/predownloaded/d4/c1/d4c114e49c827365481f401d7edbd962ea4bc611.jpg)↵
↵
~~~~~↵
import sys↵
input = lambda: sys.stdin.readline().strip()↵
↵
for _ in range(int(input())):↵
n = int(input())↵
s = input()↵
a = [0] * 26↵
↵
for i in range(n):↵
a[ord(s[i]) - ord('a')] += 1↵
↵
res = ""↵
↵
while True:↵
tempval = 0↵
for i in range(26):↵
if a[i] != 0:↵
res += chr(i + ord('a'))↵
a[i] -= 1↵
tempval = 1↵
↵
if tempval == 0:↵
break↵
↵
print(res)↵
~~~~~↵
↵
Never faced such issue till now with PyPy3-64 :(↵
Any help from experienced python coders, I'd be greatful!↵
↵
↵
↵
↵
![ ](/predownloaded/d4/c1/d4c114e49c827365481f401d7edbd962ea4bc611.jpg)↵
↵
~~~~~↵
import sys↵
input = lambda: sys.stdin.readline().strip()↵
↵
for _ in range(int(input())):↵
n = int(input())↵
s = input()↵
a = [0] * 26↵
↵
for i in range(n):↵
a[ord(s[i]) - ord('a')] += 1↵
↵
res = ""↵
↵
while True:↵
tempval = 0↵
for i in range(26):↵
if a[i] != 0:↵
res += chr(i + ord('a'))↵
a[i] -= 1↵
tempval = 1↵
break↵
↵
print(res)↵
~~~~~↵
↵
Never faced such issue till now with PyPy3-64 :(↵
Any help from experienced python coders, I'd be greatful!↵
↵
↵
↵