Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flex-algo

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flex-algo - npm Package Compare versions

Comparing version 0.1.33 to 0.1.34

33

lib/array.js
"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;

3

lib/index.d.ts

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc