Skip to content

Some solutions for leetcode problems that I found fun - either the algorithm or using numpy bruteforce where it shouldn't be

License

Notifications You must be signed in to change notification settings

arrmansa/leetcode-nice-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcode-nice-solutions

Some solutions for leetcode problems that I found fun - either the algorithm or using numpy bruteforce where it shouldn't be

Some hacks

open = print

class str: encode = lambda x: None

Serializer._serialize = lambda _, x, __: None

Some fun parsing ideas

np.fromstring('[[1,10,4,2],[9,3,8,7],[15,16,17,12]]'[2:-2].replace('],[', ''), dtype=int, sep=',')
with open('user.out', 'w') as f:
    for args in zip(*([sys.stdin]*3)):
        args = [int(val[:-1]) if val[-1] == '\n' else int(val) for val in args]
        f.write(str(getKth(*args)))
        f.write('\n')
_exit(0)

About

Some solutions for leetcode problems that I found fun - either the algorithm or using numpy bruteforce where it shouldn't be

Topics

Resources

License

Stars

Watchers

Forks

Languages