- Intermediate level
- Problem solving
- Algorithms
- Data Structures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Beautiful Strings | |
| When John was a little kid he didn't have much to do. There was no internet, no Facebook, | |
| and no programs to hack on. So he did the only thing he could... he evaluated the beauty | |
| of strings in a quest to discover the most beautiful string in the world. | |
| Given a string s, little Johnny defined the beauty of the string as the sum of the beauty | |
| of the letters in it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 20 | |
| (:a)) | |
| :)(a):)(a)(a()(()(()):a()(a))(a(a))a(a:)))a((:aa::()()()aa)):):((():)):(::a:a)()a()):):)() | |
| (()()((((((((:)aa())a():(:()a(a)):)()(:))())(a)a((((a:()(a((()()a)a)):(a(a)))a)((():))):a()) | |
| (:a()a)(a)a(aa(()(::)())(:a(a):()a(a()a(()():)))this is a min cost max flow problem(a)((a(()a)))a | |
| :::)(()::))a:):::()(a(:)(a)a)())::)()(()a)a(a)may the best hacker win:aa:)a()(())aa:::)(:())aa | |
| a(:(((()a)()()a(()()aa(a(a:::aaa(:):)a(a:a((a(())((()((:))))(a()(())():()()(a(()()a)((:)(a)))))))) | |
| :a()(())(:a(:(aa)a)):aaa()a(((a(:()))a))a():()a:)(a)aa(a)((():):aa((a)a((()):)((a)(((aa:(())))) | |
| ()((:(:)()((:aa)()(():))((a)(:(a(()))((()()a):()())aa)((:())a()(:)a()))a)aaaa)((a(()(a)a(())))) | |
| i am sick today (:() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Function recreating the functionality of float() and int() in Python. | |
| # By Neil Fraser. Public Domain. 2012. | |
| def myFloat(input = 0.0): | |
| if type(input) != str: | |
| if type(input) == bool: | |
| return input and 1.0 or 0.0 | |
| if type(input) == float: | |
| return input | |
| if type(input) in (int, long): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "response":{ | |
| "meta":{ | |
| "Requests":"0", | |
| "Timestamp":"2013-02-12T22:55:04-05:00", | |
| "Status":"200", | |
| "Message":"OK", | |
| "Version":"1.4b7" | |
| }, | |
| "data":{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package { 'Droplr': | |
| source => 'https://droplr.com/download/mac', | |
| provider => 'compressed_app' | |
| } | |
| package { 'Alfred': | |
| provider => 'compressed_app', | |
| source => 'http://cachefly.alfredapp.com/alfred_1.3.3_267.zip' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| parser = argparse.ArgumentParser(description='Generic API') | |
| parser.add_argument('--name', dest='name', help='full name') | |
| parser.add_argument('--token', dest='fbtoken', help='firebase token') | |
| args = parser.parse_args() | |
| name = args.name | |
| firebase = args.fbtoken | |
| fname, lname = name.split() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <body style=margin:0><canvas id=q /><script>var q=document.getElementById('q'),s=window.screen,w=q.width=s.width,h=q.height=s.height,p=Array(256).join(1).split(''),c=q.getContext("2d"),m=Math,r=m.random;setInterval(function(){c.fillStyle="rgba(0,0,0,0.05)";c.fillRect(0,0,w,h);c.fillStyle="rgba(0,255,0,1)";p=p.map(function(v,i){c.fillText(String.fromCharCode(m.floor(2720+r()*33)),i*10,v);v+=10;if(v>768+r()*10000)v=0;return v})},33)</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $key = ''; // enter your api key here | |
| function getLocations($key) | |
| { | |
| $url = "http://api.uwaterloo.ca/public/v1/?key=$key&service=APLocations"; | |
| $get = file_get_contents($url); |
