Thanks to hofmannsven https://gist.github.com/hofmannsven/6814451
Related Setup: https://gist.github.com/hofmannsven/6814278
| <div id="container" ng-controller="cbTimerCtrl"> | |
| <div > | |
| <div id="clock">{{timer}}</div> | |
| <button ng-click="toggleTimer()">{{mode}}</button> | |
| </div> | |
| <div> | |
| <table> | |
| <thead> | |
| <tr><th>Start</th><th>End</th><th>Duration (secs)</th></tr> | |
| </thead> |
| var tmPromise, myApp = angular.module('cbTimer',[]); | |
| ... | |
| function startTimer () { | |
| // toggle | |
| $scope.mode = "Stop"; | |
| // compute for the duration, |
| /** | |
| * @func stopTimer | |
| * handle end of timer | |
| */ | |
| functio stopTimer () { | |
| var dt = new Date(); | |
| // toggle | |
| $scope.mode = "Start"; | |
Related Setup: https://gist.github.com/hofmannsven/6814278
| /**** | |
| * | |
| * CURRYING | |
| * | |
| * Chris Bautista <chris@codespud.ca> | |
| * @chrisbautista | |
| * | |
| ****/ | |
| (function(){ |
| /** | |
| * parens exercise | |
| * | |
| * chris bautista < chris@codespud.ca > | |
| * | |
| ****/ | |
| (function(){ | |
| var startParens = [ '[','{','(' ]; |
| /** | |
| * | |
| * get max profit from stock prices | |
| * | |
| * chris bautista <chris@codespud.ca> | |
| * | |
| * */ | |
| /** |
You have an array of integers, and for each index you want to find the product of every integer except the integer at that index. Write a function get_products_of_all_ints_except_at_index() that takes an array of integers and returns an array of the products.
For example, given:
[1, 7, 3, 4] your function would return:
Given an array_of_ints, find the highest_product you can get from three of the integers. The input array_of_ints will always have at least three integers.
Does your function work with negative numbers? If array_of_ints is [-10, -10, 1, 3, 2][−10,−10,1,3,2] we should return 300 (which we get by taking −10∗−10∗3).