
215.kth-largest-element-in-an-array
/* * @lc app=leetcode id=215 lang=javascript * * [215] Kth Largest Element in an Array */ // @lc code=start //#region Heap (function() { var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup; (floor = Math.floor), (min = Math.min); /* Default comparison function to be used */ defaultCmp = function(x, y) { if (x < y) { return -1; } if (x > y) { return 1; } return 0; }; /* Insert item x in list a,...

215.kth-largest-element-in-an-array
/* * @lc app=leetcode id=215 lang=javascript * * [215] Kth Largest Element in an Array */ // @lc code=start //#region Heap (function() { var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup; (floor = Math.floor), (min = Math.min); /* Default comparison function to be used */ defaultCmp = function(x, y) { if (x < y) { return -1; } if (x > y) { return 1; } return 0; }; /* Insert item x in list a,...
Decorators and Metadata Refection in TypeScript
Annotation & DecoratorsSee annotation vs decoratorDecorators in TypeScriptdeclare type ClassDecorator = <TFunction extends Function>( target: TFunction ) => TFunction | void; declare type PropertyDecorator = ( target: Object, propertyKey: string | symbol ) => void; declare type MethodDecorator = <T>( target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T> ) => TypedPropertyDescriptor<T> | void; declare type ParameterDecorator = ( target: Object...
Decorators and Metadata Refection in TypeScript
Annotation & DecoratorsSee annotation vs decoratorDecorators in TypeScriptdeclare type ClassDecorator = <TFunction extends Function>( target: TFunction ) => TFunction | void; declare type PropertyDecorator = ( target: Object, propertyKey: string | symbol ) => void; declare type MethodDecorator = <T>( target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T> ) => TypedPropertyDescriptor<T> | void; declare type ParameterDecorator = ( target: Object...
Statement Coverage
Statement CoverageFormula number of executed statements ------------------------------- total number of statements Sourceprint_sum(int a, int b) { int result = a + b; if (result > 0) { println("%s", "red"); } else if (result < 0) { println("%s", "blue"); } } TC #1Input: a = 3, b = 9Coverage: 7 / 9 = 77.8%✅ print_sum(int a, int b) { ✅ int result = a + b; ✅ ✅ if (result > 0) { ✅ println("%s", "red"); ❌ } else if (result < 0) { ❌ println("%s", "blue"); ✅ } ✅ } TC #2Input: a = -5, b = -...
Statement Coverage
Statement CoverageFormula number of executed statements ------------------------------- total number of statements Sourceprint_sum(int a, int b) { int result = a + b; if (result > 0) { println("%s", "red"); } else if (result < 0) { println("%s", "blue"); } } TC #1Input: a = 3, b = 9Coverage: 7 / 9 = 77.8%✅ print_sum(int a, int b) { ✅ int result = a + b; ✅ ✅ if (result > 0) { ✅ println("%s", "red"); ❌ } else if (result < 0) { ❌ println("%s", "blue"); ✅ } ✅ } TC #2Input: a = -5, b = -...
Proof by Induction
Proof a basic case;An inductive hypothsis is assumed;The theorem is assumed to be true for all cases up to some limit k;Then the theorem is shown to be true for the next value, which typically k + 1;Refshttps://www.youtube.com/watch?v=wblW_M_HVQ8
Proof by Induction
Proof a basic case;An inductive hypothsis is assumed;The theorem is assumed to be true for all cases up to some limit k;Then the theorem is shown to be true for the next value, which typically k + 1;Refshttps://www.youtube.com/watch?v=wblW_M_HVQ8
Hello World
This is my first post on Mirror.xyz!