Hugh's public fiddles
-
Equilibrium Index
Write a function: function solution(A); that, given a zero-indexed array A consisting of N integers, returns any of its equilibrium indices. The function should return −1 if no equilibrium index exists.
-
Determine whether a triangle can be built from a given set of edges
By sorting the array, we have guaranteed that P+R < Q and Q+R < P (because R is always the biggest). Now what remains, is the proof that P+Q > R, that can be found out by traversing the array. The chance to find such a combination is with three adjacent values as they provide the highest P and Q.
-
What Split in Array Yields Min Value
Write a function that, given a non-empty zero-indexed array A of N integers, returns the minimal difference that can be achieved.
-
Frog Jump Problem
A small frog wants to get to the other side of the road. The frog is currently located at position X and wants to get to a position greater than or equal to Y. The small frog always jumps a fixed distance, D. Count the minimal number of jumps that the small frog must perform to reach its target.
-
Find Missing Element
Given an integer set from 1 to n, calculate the missing integer.
-
isPermutation
Check whether array N is a permutation
-
flatten a non standard array
No-Library (pure JS), HTML, CSS, JavaScript
-
Translate in CSS
No-Library (pure JS), HTML, CSS, JavaScript
-
Swapping Variable Methods
Some methods for swapping values.
-
Prime Time
Write a function to take the num parameter and return true if it is a prime number or false if it composite.
-
3n + 1 Problem
a programming challenge
-
rtwg5kre
No-Library (pure JS), HTML, CSS, JavaScript
-
Merge and Sort two sets with Javascript
No-Library (pure JS), HTML, CSS, JavaScript
-
Mediator Patter Library
Snippets for implementing Mediator Patter
-
Popup without blocker
jQuery 1.8.3, HTML, CSS, JavaScript
-
ssn validate & format
jQuery 1.10.1, HTML, CSS, JavaScript
-
returnLast in Array
jQuery 1.10.1, HTML, CSS, JavaScript
-
6u9LW
jQuery 1.10.1, HTML, CSS, JavaScript
-
S9e84
jQuery 1.10.1, HTML, CSS, JavaScript
-
VWWsu
jQuery 1.10.1, HTML, CSS, JavaScript