Skip to content

Instantly share code, notes, and snippets.

@adrianlzt
Created February 26, 2019 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianlzt/79663a59b388ecac93f5ee78e8e8a1a3 to your computer and use it in GitHub Desktop.
Save adrianlzt/79663a59b388ecac93f5ee78e8e8a1a3 to your computer and use it in GitHub Desktop.
stub
#!/bin/ruby
require 'json'
require 'stringio'
# Complete the maxSubsetSum function below.
def maxSubsetSum(arr)
end
fptr = File.open(ENV['OUTPUT_PATH'], 'w')
n = gets.to_i
arr = gets.rstrip.split(' ').map(&:to_i)
res = maxSubsetSum arr
fptr.write res
fptr.write "\n"
fptr.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment