This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Problem | |
Convert a sorted array into a balanced BST. Return the root of the created tree. | |
Function Signature: | |
func arrayToBST(input: [Int]) -> Node | |
Target runtime and space complexity: | |
Runtime: O(n) | |
Space: O(1), not including space used to create BST, otherwise O(n) | |
Examples: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
You are given a series of inputs representing delivery events. Each event is represented by an array of length 3: | |
[1, 1591846068, 0] | |
The first element is an order number | |
The second is the timestamp | |
The third is either 0 (representing a pickup) or 1 (representing a dropoff) | |
Given a series of events, return the total active time, calculated by the period of time where they have an active delivery (if they've dropped everything off, they are not considered active until they pick something up again). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Rating of Confidence: 80% | |
Practiced Date: 04/15/2022 | |
Q. Given an array of positive integers, find the first element that occurs k number of times. If no element occurs k times, return -1, and you may assume k is greater than 0. | |
Examples: | |
• Given an array: [1, 2, 2, 3, 3], k: 2 // returns 2 | |
• Given an array: [], k: 1 // returns -1 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof (CFADashboard) == 'undefined') { | |
var CFADashboard = {}; | |
} | |
CFADashboard.AdminOnlineVideoControl = (function () { | |
var _config; | |
return { | |
init: function (config) { | |
_config = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
UserName as Name, | |
Email as email, | |
Role as role, | |
PageVisited as ViewedPage, | |
/*Count(PageVisited) as NumberofHits,*/ | |
COUNT(CAST(Date as date)) as NumberOfVisits, | |
CAST(Date as date) as LastVisitedDate | |
from [dbo].[UserActivityLog] | |
where EMAIL NOT LIKE '%starcom%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Read the value of a header in the current document. | |
* | |
* This uses a [single] XMLHTTPRequest to do a HEAD of the current document | |
* and fetch HTTP response header values. Note that the implementation is | |
* rather stupid in that it spins waiting for the XMLHTTPRequest to complete | |
* if it hasn't been called yet. | |
* | |
* @param name string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var data1; | |
var data2; | |
d3.text("display.txt").then(function(text) { | |
var cells=text.split("\n").map(function(el){ | |
return el.split("|"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var data1; | |
var data2; | |
d3.text("display.txt").then(function(text) { | |
var cells=text.split("\n").map(function(el){ | |
return el.split("|"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************** | |
* | |
* Currently does not work due to http://community.tableau.com/thread/131070 | |
* | |
*********************************************************/ | |
var viz = tableau.VizManager.getVizs()[0] |
NewerOlder