Comparing version 0.1.44 to 0.1.45
export declare function twoSum(nums: number[], target: number): number[]; | ||
export declare function maxArea(heights: number[]): number; | ||
export declare function moveZeroes(nums: number[]): void; | ||
export declare function findDuplicate(nums: number[]): number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.moveZeroes = exports.maxArea = exports.twoSum = void 0; | ||
exports.findDuplicate = exports.moveZeroes = exports.maxArea = exports.twoSum = void 0; | ||
function twoSum(nums, target) { | ||
@@ -49,1 +49,14 @@ var map = {}; | ||
exports.moveZeroes = moveZeroes; | ||
function findDuplicate(nums) { | ||
var map = {}; | ||
for (var i = 0; i < nums.length; i++) { | ||
if (map[nums[i]] !== undefined) { | ||
return nums[i]; | ||
} | ||
else { | ||
map[nums[i]] = i; | ||
} | ||
} | ||
return -1; | ||
} | ||
exports.findDuplicate = findDuplicate; |
@@ -10,3 +10,3 @@ import { PriorityQueue } from './priorityQueue'; | ||
import { lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, hash, groupAnagrams, multiply } from './string'; | ||
import { twoSum, maxArea, moveZeroes } from './array'; | ||
import { twoSum, maxArea, moveZeroes, findDuplicate } from './array'; | ||
import { isValidParentheses, minRemoveToMakeValid } from './stack'; | ||
@@ -17,2 +17,2 @@ import { StackQueue } from './stackQueue'; | ||
import { longestPalindrome, maxSubArray } from './dynamicProgramming'; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, longestPalindrome, hash, groupAnagrams, multiply, maxSubArray, twoSum, maxArea, moveZeroes, isValidParentheses, minRemoveToMakeValid, StackQueue, ValueType, LinkedList, }; | ||
export { PriorityQueue, BinaryTree, BinaryNode, BST, quickSort, pivot, quickSelect, quickSelectPivot, binarySearch, binarySearchRange, searchRange, Graph, Dijkstra, Matrix, lengthOfLongestSubstring, lengthOfLongestSubstringTwoDistinct, backspaceCompare, isPalindrome, strip, isSubPalindrome, longestPalindrome, hash, groupAnagrams, multiply, maxSubArray, twoSum, maxArea, moveZeroes, findDuplicate, isValidParentheses, minRemoveToMakeValid, StackQueue, ValueType, LinkedList, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LinkedList = exports.StackQueue = exports.minRemoveToMakeValid = exports.isValidParentheses = exports.moveZeroes = exports.maxArea = exports.twoSum = exports.maxSubArray = exports.multiply = exports.groupAnagrams = exports.hash = exports.longestPalindrome = exports.isSubPalindrome = exports.strip = exports.isPalindrome = exports.backspaceCompare = exports.lengthOfLongestSubstringTwoDistinct = 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.LinkedList = exports.StackQueue = exports.minRemoveToMakeValid = exports.isValidParentheses = exports.findDuplicate = exports.moveZeroes = exports.maxArea = exports.twoSum = exports.maxSubArray = exports.multiply = exports.groupAnagrams = exports.hash = exports.longestPalindrome = exports.isSubPalindrome = exports.strip = exports.isPalindrome = exports.backspaceCompare = exports.lengthOfLongestSubstringTwoDistinct = 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"); | ||
@@ -40,2 +40,3 @@ Object.defineProperty(exports, "PriorityQueue", { enumerable: true, get: function () { return priorityQueue_1.PriorityQueue; } }); | ||
Object.defineProperty(exports, "moveZeroes", { enumerable: true, get: function () { return array_1.moveZeroes; } }); | ||
Object.defineProperty(exports, "findDuplicate", { enumerable: true, get: function () { return array_1.findDuplicate; } }); | ||
var stack_1 = require("./stack"); | ||
@@ -42,0 +43,0 @@ Object.defineProperty(exports, "isValidParentheses", { enumerable: true, get: function () { return stack_1.isValidParentheses; } }); |
{ | ||
"name": "flex-algo", | ||
"version": "0.1.44", | ||
"version": "0.1.45", | ||
"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
61503
1706