wnnmaw
• Member for 7 years, 6 months
• Last seen more than a month ago

Python 2, 37 39 bytes lambda a,b:b.join(a.split(b,1)[::-1]) Where a is the main string and b is the pivot string. Try it online!

Python 2, 114 71 bytes Turns out I was re-inventing the wheel, a simple double replace on a multiline string works quite well. The string has the additional benefit of being able to count zeros ...

Python, 137 139 n=input() print n,len([b for b in range(len([a for a in range(n)if not all(a%i for i in xrange(2,a))]))if all(b%i for i in xrange(2,b))])

Python, 398 414 380 456 bytes* Managed to update so that it is compliant with the rules, but I still hesitate to call this competitive. Since the commented lines are needed for it to run, I've ...

Python 2, 334 p=open("f.txt",'r').readlines() r,S,p=p[0][7:],p[2].strip(),p[3:-1] import textwrap as t,itertools as i m,l=max([len(s[:-5].strip()) for s in p]),len(S)-2 P = i.izip_longest([&...

Python 2, 157 132 bytes def f(s): S=int(s[1:-1]) for n in([range(1,S+2,2),range(S,0,-2)]['-'in s],[S]*S)['s'in s]: print "{:^{S}}".format('*'*n,S=S) First attempt firgured that the +/- ...

Python 2.7, 79 75 88 s=input() print (0,(1,-1)[s[-1]=='v'])[len(s[s.rfind(('v^','^v')[s[-1]=='v'])+1:])%2!=0]

Python 2.7, 173 165 bytes 8 bytes saved by quintopia This one got gross: lambda S:`[(t[0],t[0].upper())[t[1]]for t in zip("".join("first".join(s.replace("first","...

Python 2, 115 bytes lambda s:'\n'.join("".join(s)for s in zip(*[k[-i%len(k):]+k[:-i%len(k)]for i,k in enumerate(zip(*s.split('\n')))])) Thanks to the wonder of zip managed to get this down ...

Python 2, 90 bytes lambda A,B:all(ord(b)-2<ord(a)<ord(b)+2for a,b in zip(sorted(A),sorted(B)))*len(A)==len(B) Simple anonymous function, I have to have a separate check for length because zip ...

Python 2 + numpy, 31 bytes I think this is kosher based on the rules, but let me know if not. Anonymous function takes a numpy array as input: import numpy lambda l:l+l[::-1] Try it online!