Skip to content

Instantly share code, notes, and snippets.

View praveenKajla's full-sized avatar
😍
go

Praveen k. praveenKajla

😍
go
  • loco
  • Jaipur, India
View GitHub Profile
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
@Metadata(
mv = {1, 1, 7},
bv = {1, 0, 2},
k = 2,
d1 = {"\u0000\u001a\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u001a\u0019\u0010\u0000\u001a\u00020\u00012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003¢\u0006\u0002\u0010\u0005\u001a\u0014\u0010\u0006\u001a\u00020\u00012\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00010\u0007¨\u0006\b"},
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
@Metadata(
mv = {1, 1, 7},
bv = {1, 0, 2},
k = 2,
d1 = {"\u0000\u001a\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u001a\u0019\u0010\u0000\u001a\u00020\u00012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003¢\u0006\u0002\u0010\u0005\u001a\u0017\u0010\u0006\u001a\u00020\u00012\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00010\u0007H\u0086\b¨\u0006\b"},
/**
* Performs the given [action] on each element.
*/
@kotlin.internal.HidesMembers
public header inline fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit
/**
* Performs the given [action] on each element, providing sequential index with the element.
* @param [action] function that takes the index of an element and the element itself
* and performs the desired action on the element.
const arr = () => {
console.log("executed")
}
arr();
package readinglist
class DirectoryExplorer(val user:String){
inner class PermissionCheck(){
fun validatePermission(){
}
}
class Log(){
companion object Factory{
@JvmStatic fun createFileLog(filename: String):Log = Log(filename)
//we can access this static function from java using @JvmStatic as Log.createFileLog("File.txt")
}
//second companion object not possible
constructor(filename:String):this(){}
"use strict";
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
var log = console.log;
function example(a, b, c) {
log({ a: a, b: b, c: c });
return a * b * c;
}
@praveenKajla
praveenKajla / leftArrayRotate.js
Last active October 15, 2017 07:04
Write a function rotate(ar[], d, n) that rotates arr[] of size n by d element
//Write a function rotate(ar[], d, n) that rotates arr[] of size n by d elements
//https://www.youtube.com/watch?v=utE_1ppU5DY
//pass 1
//1.copy first d elements in temp array
//2.move original array forward by d
//3.start updating vlues in originl array from n-d th position
// time complexity n space complexity d
function rotate1(arr=[],d){
let n = arr.length
let temp = []