Skip to content

Instantly share code, notes, and snippets.

View ytaminE's full-sized avatar
🏠
Working from home

Yuanyi Yang ytaminE

🏠
Working from home
  • Home
  • Toronto, Ontario, Canada
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="projectConfiguration" value="Nosetests" />
<option name="PROJECT_TEST_RUNNER" value="Nosetests" />
@ytaminE
ytaminE / orient_express_two_sum_solution.md
Last active November 30, 2017 02:14
Solution for TwoSum

Solution for TwoSum

Input: nums are [2, 7, 11, 15] and target is 9

[2,7,11,15,9]

Result:

[0,1]
import urllib2
import StringIO
import sys
import contextlib
import ast
@contextlib.contextmanager
def stdoutIO(stdout=None):
old = sys.stdout
if stdout is None:
stdout = StringIO.StringIO()
{
"name": "TwoSum",
"url": "https://s3.amazonaws.com/xxxxx/python/xxxx.xxxx-at-foxmail.com/TwoSum/2017-11-23-00-35-34/TwoSum.py",
"input": [
10,1,7,8,9
]
}
class Test
def test(name, input)
require "/tmp/file"
result = Solution.new.send(name,input)
puts result
end
end
const exec = require('child_process').exec;
exports.handler = function(event, context, callback) {
var url = event['url'];
var input = event['input'];
var name = event['name'];
const child = exec('curl ' + url + '>' + '/tmp/file.rb\n'+
'chmod 755 /tmp/file.rb\n'+
'./bin/ruby -r "./evaluate.rb" -e "Test.new.test ' + '\'' + name + '\'' + ',' + input + '"', (result) => {
});
const exec = require('child_process').exec;
exports.handler = (event, context, callback) => {
var url = event['url'];
var input = JSON.parse(event['input']);
var name = event['name'];
const child = exec(
'rm /tmp/' + name + '.js\n' +
'curl ' + url + '>' + '/tmp/'+name+'.js\n'+
'chmod 755 /tmp/' + name + '.js\n',(result) => {
@ytaminE
ytaminE / quicksort_linkedlist.java
Created February 6, 2018 18:36
quicksort for linkedlist
class ListNode {
int val;
ListNode next;
public ListNode(int val) {
this.val = val;
}
}
public class linked_list_quicksort {