Library Date : Link
Doc : Link
Scanner :
import java.util.Scanner;| // Welcome to the TypeScript Playground, this is a website | |
| // which gives you a chance to write, share and learn TypeScript. | |
| // You could think of it in three ways: | |
| // | |
| // - A place to learn TypeScript in a place where nothing can break | |
| // - A place to experiment with TypeScript syntax, and share the URLs with others | |
| // - A sandbox to experiment with different compiler features of TypeScript | |
| const anExampleVariable = "Hello World" |
| #include <iostream> | |
| #include <stdlib.h> | |
| using namespace std; | |
| // g++ bmi.cpp -o bmi && ./bmi | |
| int main() | |
| { | |
| // bmi = weight / height ** 2 |
| 'use strict'; | |
| const fs = require('fs'); | |
| process.stdin.resume(); | |
| process.stdin.setEncoding('utf-8'); | |
| let inputString = ''; | |
| let currentLine = 0; |
| const INCREMENT = 'INCREMENT', // Define a constant for increment action types | |
| DECREMENT = 'DECREMENT', // Define a constant for decrement action types | |
| MULTIPLY = 'MULTIPLY', | |
| DIVIDE = 'DIVIDE'; | |
| const counterReducer = (state= 0, action) => { | |
| switch(action.type) { | |
| case INCREMENT : | |
| return state + 1 |
| const squareList = (arr) => { | |
| // Only change code below this line | |
| if (Array.isArray(arr)) { // check if the arr is an arrat | |
| console.log('hello world') | |
| arr = arr.filter(element => typeof parseInt(element) == 'number') | |
| .filter(element => element > 0 && element.toString().indexOf('.') == -1) | |
| .map(element => element ** 2); | |
| console.log(arr) | |
| return arr; | |
| }else |
| // The global variable | |
| var watchList = [ | |
| { | |
| "Title": "Inception", | |
| "Year": "2010", | |
| "Rated": "PG-13", | |
| "Released": "16 Jul 2010", | |
| "Runtime": "148 min", | |
| "Genre": "Action, Adventure, Crime", | |
| "Director": "Christopher Nolan", |
| // tabs is an array of titles of each site open within the window | |
| var Window = function(tabs) { | |
| this.tabs = tabs; // We keep a record of the array inside the object | |
| }; | |
| // When you join two windows into one window | |
| Window.prototype.join = function (otherWindow) { | |
| this.tabs = this.tabs.concat(otherWindow.tabs); | |
| return this; | |
| }; |
| // tabs is an array of titles of each site open within the window | |
| var Window = function(tabs) { | |
| this.tabs = tabs; // We keep a record of the array inside the object | |
| }; | |
| // When you join two windows into one window | |
| Window.prototype.join = function (otherWindow) { | |
| console.log(this.tabs) | |
| this.tabs = this.tabs.concat(otherWindow.tabs); | |
| return this; |
| function getIndexToIns(arr, num) { | |
| let result; | |
| if (arr.indexOf(num) == -1) { | |
| let N = Math.min(...arr.filter(e => e > num)); | |
| console.log(N); | |
| N = arr.indexOf(N) | |
| console.log(N) | |
| result = N; | |
| // console.log(arr.indexOf(r)) | |
| }else { |