Last active
June 11, 2018 05:01
-
-
Save MirzaChilman/11a797c87d44e2d4da5b2c5daeaa2713 to your computer and use it in GitHub Desktop.
JS Bin// source http://jsbin.com/wevagebiqu
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
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
"use strict"; | |
var A = [3, 8, 9, 7, 6]; | |
var K = 3; | |
var i = 0; | |
function solution(A, K) { | |
for (i; i < K; i++) { | |
var tes = A.pop(); | |
A.unshift(tes); | |
} | |
return A; | |
} | |
console.log(solution(A, K)); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
"use strict"; | |
var A = [3, 8, 9, 7, 6]; | |
var K = 3; | |
var i = 0; | |
function solution(A, K) { | |
for (i; i < K; i++) { | |
var tes = A.pop(); | |
A.unshift(tes); | |
} | |
return A; | |
} | |
console.log(solution(A, K)); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
var A = [3, 8, 9, 7, 6] | |
var K = 3 | |
var i = 0 | |
function solution(A, K) { | |
for(i;i<K;i++){ | |
var tes = A.pop() | |
A.unshift(tes) | |
} | |
return A | |
} | |
console.log(solution(A,K))</script></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment