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
raw_input() | |
m = raw_input() | |
w = raw_input() | |
w = [float(i) for i in w.split()] | |
m = sum([w[int(i)] * int(j) for i, j in enumerate(m.split())]) | |
print "%.1f" % (m / sum(w)) |
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
class BankAccount(): | |
def withdraw(): | |
pass | |
def deposit(): | |
pass | |
class SavingsAccount(BankAccount): | |
def __init__(self): | |
self.balance = 500 | |
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
def replicate_recur(times, data): | |
try: | |
if type(data) is not(int) and type(data) is not(str): | |
raise ValueError("Wrong Input Found!") | |
arr = [] | |
def recur(times, data): | |
if times <= 0: | |
return arr | |
else: | |
arr.append(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
def manipulate_data(lst): | |
if type(lst) is not(list): | |
print type(lst) | |
return "Only lists allowed" | |
negatives = sum(filter(lambda x: x < 0, lst)) | |
positives = len(filter(lambda x: x > -1, lst)) | |
return [positives, negatives] |
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 main() { | |
let N = readLine() | |
let S = N.match(/.{1,3}/g); | |
let R = 'SOS'.repeat(N.length / 3).match(/.{1,3}/g); | |
let count = 0; | |
for (let i in S) { | |
for (let j in S[i]) { | |
if (S[i][j] !== R[i][j]) { |
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 main() { | |
let S = readLine().match(/.{1,3}/g); | |
let count = 0; | |
for (let i in S) { | |
if (S[i][0] !== 'S') { | |
count++; | |
} | |
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
const log = (...args) => args.map(arg => console.log(arg)); // Pollyfill for Logging each args on a new line | |
function processData(input) { | |
let ARR = input.split('\n'); | |
ARR.shift(); | |
ARR = ARR.join().split(' ').map(Number).sort((a, b) => a - b); | |
let Q1a = []; // First Quartile Array | |
let Q3a = []; // Third Quartile Array | |
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 main() { | |
var n_temp = readLine().split(' '); | |
var n = parseInt(n_temp[0]); | |
var k = parseInt(n_temp[1]); | |
a = readLine().split(' '); | |
a = a.map(Number); | |
var i = k; | |
if (k > n) { |
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
const express = require('express'); | |
// Chalk was added by create-react-app, use only on the dev side | |
const chalk = require('chalk'); | |
// Initialize express | |
const app = express(); | |
const PORT = process.env.PORT || 3000; | |
// Start up our express server | |
app.listen(PORT, (error) => { |
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
{ | |
"name": "express-without-eject", | |
"version": "0.1.0", | |
"private": true, | |
"devDependencies": { | |
"react-scripts": "0.7.0" | |
}, | |
"dependencies": { | |
"express": "^4.14.0" | |
}, |