Skip to content

Instantly share code, notes, and snippets.

View gsasouza's full-sized avatar
🔥
Working on bleeding edge

Gabriel Souza gsasouza

🔥
Working on bleeding edge
View GitHub Profile
Convert the given number into a roman numeral.
All roman numerals answers should be provided in upper-case.
Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code.
Here are some helpful links:
Roman Numerals
Array.prototype.splice()
atom-sync
process.env.NODE_ENV = 'test';
const chai = require('chai'),
should = chai.should(),
chaiHttp = require('chai-http');
const Employee = require('../models/employeeModel'),
Company = require('../models/companyModel'),
app = require('../app');
process.env.NODE_ENV = 'test';
const chai = require('chai'),
should = chai.should(),
chaiHttp = require('chai-http');
const User = require('../models/userModel'),
Company = require('../models/companyModel'),
function(error, client, next){
var dirName = './balanceSheets/' + this.clientId;
fs.mkdir(dirName, function(err){
console.log(err);
if(err) return next(err);
});
}
/**
* Created by Gabriel Souza on 30/11/2016.
*/
'use strict';
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
fs = require('fs'),
bCrypt = require('bcrypt-nodejs'),
saltRounds = require('config').saltRounds,
const Schema = mongoose.Schema({
atributo: {
type: [String],
validate: {
validator: (value) => value.lenght > 0
}
}
}
class Element:
index = 0
data_size = 0
data = []
def __init__(self, index, data_size, data):
self.index = int(index)
self.data_size = data_size
self.data = data
const count = (value, solution) => solution.filter((e) => e === value).length
const isSafe = (row, solution) => {
const column = solution.length;
if (count(row, solution) > 0) return false;
for (const i of solution) if (Math.abs(i - row) === Math.abs(i - column)) return false;
return true;
}
const maxLen = 30;
const solve = (solution, column) => {
def max_heapify(arr, heap_size, i):
left = 2 * i + 1
right = 2 * i + 2
largest = i
if left < heap_size and arr[left] > arr[largest]:
largest = left
if right < heap_size and arr[right] > arr[largest]:
largest = right
if largest != i:
arr[i], arr[largest] = arr[largest], arr[i]