This file contains 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 BinaryGap(N) { | |
//get N binary representation | |
let Nbin = N.toString(2); | |
//trim from start to last 1 | |
const lastIndexOfOne = Nbin.lastIndexOf('1') | |
Nbin = Nbin.substr(0,lastIndexOfOne); | |
//split by 1 | |
let Gaps = Nbin.split('1').map(el=> el.length); | |
// take max length | |
return Math.max(...Gaps); |
This file contains 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
using namespace System.Net | |
# Input bindings are passed in via param block. | |
param($Request, $TriggerMetadata) | |
# Interact with query parameters or the body of the request. | |
$rgname = $Request.Query.resourcegroup | |
if (-not $rgname) { | |
$rgname = $Request.Body.resourcegroup | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body{ | |
margin:0; | |
} | |
.container{ | |
width:25vw; | |
height: 100vh; |