Comparing version 0.1.33 to 0.1.34
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.maxArea = exports.twoSum = void 0; | ||
function twoSum(nums, target) { | ||
var map = {}; | ||
for (var i = 0; i < nums.length; i++) { | ||
var expect_1 = target - nums[i]; | ||
if (map[expect_1] !== undefined) { | ||
return [map[expect_1], i]; | ||
} | ||
map[nums[i]] = i; | ||
} | ||
return [-1, -1]; | ||
} | ||
exports.twoSum = twoSum; | ||
function maxArea(heights) { | ||
if (heights.length === 0) | ||
return 0; | ||
var max = 0; | ||
var left = 0; | ||
var right = heights.length - 1; | ||
while (left < right) { | ||
var area = Math.min(heights[left], heights[right]) * (right - left); | ||
max = Math.max(max, area); | ||
if (heights[left] < heights[right]) { | ||
left += 1; | ||
} | ||
else { | ||
right -= 1; | ||
} | ||
} | ||
return max; | ||
} | ||
exports.maxArea = maxArea; |
@@ -10,2 +10,3 @@ import { PriorityQueue } from './priorityQueue'; | ||
import { lengthOfLongestSubstring, backspaceCompare, isPalindrome, strip, isSubPalindrome } from './string'; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, backspaceCompare, isPalindrome, strip, isSubPalindrome, }; | ||
import { twoSum, maxArea } from './array'; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, backspaceCompare, isPalindrome, strip, isSubPalindrome, twoSum, maxArea, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isSubPalindrome = exports.strip = exports.isPalindrome = exports.backspaceCompare = exports.lengthOfLongestSubstring = exports.Matrix = exports.Dijkstra = exports.Graph = exports.searchRange = exports.binarySearchRange = exports.binarySearch = exports.quickSelectPivot = exports.quickSelect = exports.pivot = exports.quickSort = exports.BST = exports.BinaryNode = exports.BinaryTree = exports.PriorityQueue = void 0; | ||
exports.maxArea = exports.twoSum = exports.isSubPalindrome = exports.strip = exports.isPalindrome = exports.backspaceCompare = exports.lengthOfLongestSubstring = exports.Matrix = exports.Dijkstra = exports.Graph = exports.searchRange = exports.binarySearchRange = exports.binarySearch = exports.quickSelectPivot = exports.quickSelect = exports.pivot = exports.quickSort = exports.BST = exports.BinaryNode = exports.BinaryTree = exports.PriorityQueue = void 0; | ||
var priorityQueue_1 = require("./priorityQueue"); | ||
@@ -32,1 +32,4 @@ Object.defineProperty(exports, "PriorityQueue", { enumerable: true, get: function () { return priorityQueue_1.PriorityQueue; } }); | ||
Object.defineProperty(exports, "isSubPalindrome", { enumerable: true, get: function () { return string_1.isSubPalindrome; } }); | ||
var array_1 = require("./array"); | ||
Object.defineProperty(exports, "twoSum", { enumerable: true, get: function () { return array_1.twoSum; } }); | ||
Object.defineProperty(exports, "maxArea", { enumerable: true, get: function () { return array_1.maxArea; } }); |
{ | ||
"name": "flex-algo", | ||
"version": "0.1.33", | ||
"version": "0.1.34", | ||
"description": "\"SDK for commonly used data structure and algorithms\"", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46087
1272