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
var snakePrint = function(numbers, width) { | |
var xyTo1D = function(x, y) { | |
return y * width + x; | |
}; | |
var matrix = numbers.split(','), | |
directions = [[1, 0], [0, 1], [-1, 0], [0, -1]], | |
output = '', | |
snake = { | |
length: 0, |
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 makeItLarge(inputs) { | |
inputs.collect { input -> | |
nextLexicographically(input) | |
} | |
} | |
def nextLexicographically(input) { | |
def queue = new java.util.PriorityQueue<Character>() | |
def a = input.toCharArray() | |
def pivot = -1 |
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
val matrix = Array( | |
Array(0, 1, 0, 0, 1), | |
Array(0, 1, 1, 1, 1), | |
Array(1, 0, 1, 1, 0), | |
Array(1, 1, 0, 0, 1) | |
) | |
val rows = matrix.indices | |
val columns = matrix(0).indices |
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
public class BinaryGap { | |
public static int maxBinaryGap(int N) { | |
int maxGap = 0; | |
int currentGap = 0; | |
boolean oneFound = false; | |
while (N > 0) { | |
if (N % 2 == 1) { | |
oneFound = true; | |
maxGap = Math.max(currentGap, maxGap); |
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'); | |
const { getProfile } = require('../middleware/getProfile'); | |
const validators = require('../middleware/validators'); | |
const { | |
contractsController, | |
jobsController, | |
balancesController, | |
adminController | |
} = require('../controllers') |
OlderNewer