edit-task
Home
Up
Delete
Task Name:
Task Description:
CREATE-article - tech interview type problem questions
TaskGroup ID:
Start Date:
Start Time:
Duration:
Priority:
Status:
To Do
Completed
In Process
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">CREATE-article# #</h1> <h2>[previously]</h2> <ol> <li><strong>[2017-01-dd][00:00] NEW task IN ?</strong></li> <ol> <li>] # # - CREATE-article# # </li> </ol> <li><strong>[00:00] NEW article IN </strong></li> <ol> <li>] # # - </li> </ol></ol> <h2>[currently]</h2> <ol> <li>] </li> </ol> <h2>[next]</h2> <ol> <li>]</li> </ol> <p> </p> <p><strong>PRB - 00n -</strong></p> <p><br />REF = https://www.youtube.com/watch?v=lD-LuK_VGZI</p> <p>Array [, 1,2, 3, 4,5,7,9,33,-5,]<br /><br />Find 2 numbers that when multiplied together will equal 20 <br /><br />> 1] Figure it out solution to problem on “paper” before coding, ex SOL 1</p> <p>- look at first number in array</p> <p>- determine the 'multiplier' that firstNumber would need to get to desired sum</p> <p>- search balance of array for matchingNumber</p> <p>- if matchingNumber found, return pair()</p> <p>- else moveNextNumber, repeat process</p> <p> ex SOL 2, larger array of numbers</p> <p>- put each uniqe nu</p> <p>> 2] translat into data structures and algorithms</p> <p>------------</p> <p>description: function that takes array of numbers and returns 2 elements that will multiply to twenty</p> <p>takes:array of numbers</p> <p>returns: 2 numbers</p> <p> </p> <p>function returnTwoNumbersThatMultipliedEqualTwenty(arrayNumbers){</p> <p>for ( i =0,i< arrayNumbers.length, i++){ </p> <p> firstNumber = arrayNumbers[0];</p> <p> matchNumber = firstNumber / 20;</p> <p> for (j = i+1, J < arrayNumbers.length, j++){</p> <p> if (arrayNumbers[j] === matchNumber){</p> <p> matched = [];</p> <p> matched.push(firstNumber);</p> <p> matched.push(matchNumber);</p> <p> return matched;</p> <p> }</p> <p> /*else{</p> <p> j++;</p> <p> }*/</p> <p> }</p> <p>}</p> <p>} // END function</p> <p> </p> <hr /> <p> </p> <p> </p> <p><strong>pRB - 002 - twenty five horses</strong></p> <p>REF = https://www.youtube.com/watch?v=i-xqRDwpilM</p> <p> </p> <p>my solution on Paper ( before watching video)</p> <p>- 25 totalHorses / 5 maxHorsesPerRace = 5 races, produce 5 raceWinners</p> <p>- totalRaces = 5</p> <p>- 5 raceWinners> race > move winner into fastest5Set[], remove from winnnerSet, note originating set , remove all winners from originating sets</p> <p>- totalRaces = 6</p> <p><span style="text-decoration: line-through;">- race 5 sets of 4 horses > move winners into winnersSet[]</span></p> <p><span style="text-decoration: line-through;">- totalRaces = 11</span></p> <p>- race set of remaining 4 horses from winnerRound1.set > move winner into winnersSet[]</p> <p>- totalRaces = 7</p> <p>- race winnersSet[] > move winner into fiveFastestSet[] as #2 of 5, note originating set, remove winner from winnersSet, from originating set</p> <p>- race originatingSet of winner ( ex set3)</p> <p>- totalRaces = 8 </p> <p>- move winner into winnersSet, remove from originating set</p> <p>- race winnersSet[] > move winner into fiveFastestSet[] as #3 of 5, note originating set, remove winner from winnersSet, from originating set</p> <p>- totalRaces = 9</p> <p>- repeat 2 more times for total of 11 races</p>