Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, two is written as II in Roman numeral, just two one’s added together. Twelve is written as, XII, which is simply X + II. The number twenty seven is written as XXVII,Continue Reading

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, two is written as II in Roman numeral, just two one’s added together. Twelve is written as, XII, which is simply X + II. The number twenty seven is written as XXVII,Continue Reading

Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water. Note: You may not slant the containerContinue Reading

Given an input string (s) and a pattern (p), implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). Note: s could be empty and contains only lowercase letters a-z. p could be emptyContinue Reading

Principal Component Analysis – PCA is the process of projecting variance of data using minimal dimensions. The direction of dimension along which the variance is maximised(highest) will be chosen as the first principal component. The next best direction as the second P.C. and should be orthogonal to the first P.C,Continue Reading

k-means clustering is a method of vector quantization which finds good inter similarity between cluster members and intra-similarity between other clusters. k-means clustering partitions n observations into k clusters in which each observation belongs to the cluster with the nearest mean, These means are chosen so that in the nextContinue Reading

Non-maximum suppression is used in CV in object detection where multiple probabilities that are above the given threshold are detected(classification result). Thus non-maximum suppression can help to suppress all the gradient values (by setting them to 0) except the local maxima classification result. If the strength of the current pixel/elemntContinue Reading

Similarity Measure The Jaccard index/coefficient, aka Intersection over Union is used  in computer vision as one of the similarity measures for object detection on images. Formula The Jaccard similarity coefficient,aka Intersection over Union (IOU) score:     Binary classification  Formula The same score above can be described as binary classification as well to get anContinue Reading

Subtraction Of Arrays – How to get out of an array A only items that are not in array b, thus subtracting from array A all items of array B. PHP: We can try on our own: <?php function SubtractionOfArrays($vectorA,$vectorB) { $countA=count($vectorA); $countB=count($vectorB); $numberOfElementsCaught=0; for($i=0;$i<$countA;$i++) { for($j=0;$j<$countB;$j++) { if($vectorA[$i]==$vectorB[$j]) $numberOfElementsCaught+=1;Continue Reading