From b69e92131a44d84f16b010d49c077dade9ca78a1 Mon Sep 17 00:00:00 2001 From: Kohei Asai Date: Tue, 1 Oct 2019 11:12:48 -0700 Subject: [PATCH] Denosize --- .gitignore | 1 - README.md | 26 +- jest.config.js | 4 - package-lock.json | 5051 ----------------- package.json | 19 - solutions/addBinary.test.ts | 14 - solutions/{addBinary.ts => add_binary.ts} | 4 +- solutions/add_binary_test.ts | 8 + solutions/backspaceStringCompare.test.ts | 16 - ...Compare.ts => backspace_string_compare.ts} | 4 +- solutions/backspace_string_compare_test.ts | 10 + solutions/bestTimeToBuyAndSellStock.test.ts | 16 - ....ts => best_time_to_buy_and_sell_stock.ts} | 4 +- .../best_time_to_buy_and_sell_stock_test.ts | 10 + solutions/binarySearch.test.ts | 14 - solutions/binaryTreeInorderTraversal.test.ts | 21 - .../binaryTreeLevelOrderTraversal.test.ts | 23 - .../binaryTreePostorderTraversal.test.ts | 21 - solutions/binaryTreePreorderTraversal.test.ts | 21 - .../{binarySearch.ts => binary_search.ts} | 0 solutions/binary_search_test.ts | 8 + ...al.ts => binary_tree_inorder_traversal.ts} | 2 +- .../binary_tree_inorder_traversal_test.ts | 27 + ...s => binary_tree_level_order_traversal.ts} | 2 +- .../binary_tree_level_order_traversal_test.ts | 25 + ....ts => binary_tree_postorder_traversal.ts} | 2 +- .../binary_tree_postorder_traversal_test.ts | 27 + ...l.ts => binary_tree_preorder_traversal.ts} | 2 +- .../binary_tree_preorder_traversal_test.ts | 27 + solutions/bullsAndCows.test.ts | 19 - .../{bullsAndCows.ts => bulls_and_cows.ts} | 4 +- solutions/bulls_and_cows_test.ts | 13 + solutions/climbingStairs.test.ts | 11 - .../{climbingStairs.ts => climbing_stairs.ts} | 4 +- solutions/climbing_stairs_test.ts | 11 + solutions/countCompleteTreeNodes.test.ts | 17 - solutions/countUnivalueSubtrees.test.ts | 16 - .../{countAndSay.ts => count_and_say.ts} | 4 +- ...ntAndSay.test.ts => count_and_say_test.ts} | 32 +- ...eNodes.ts => count_complete_tree_nodes.ts} | 8 +- solutions/count_complete_tree_nodes_test.ts | 11 + ...Subtrees.ts => count_univalue_subtrees.ts} | 2 +- solutions/count_univalue_subtrees_test.ts | 14 + solutions/diameterOfBinaryTree.test.ts | 51 - ...naryTree.ts => diameter_of_binary_tree.ts} | 2 +- solutions/diameter_of_binary_tree_test.ts | 46 + solutions/distance_between_bus_stops.ts | 23 + solutions/distance_between_bus_stops_test.ts | 9 + ...LastPositionOfElementInSortedArray.test.ts | 15 - solutions/findKClosestElements.test.ts | 16 - .../findMinimumInRotatedSortedArray.test.ts | 18 - solutions/findPeakElement.test.ts | 29 - solutions/findTheTownJudge.test.ts | 18 - ...ng.ts => find_all_anagrams_in_a_string.ts} | 0 ... => find_all_anagrams_in_a_string_test.ts} | 32 +- ...st_position_of_element_in_sorted_array.ts} | 0 ...osition_of_element_in_sorted_array_test.ts | 9 + ...Elements.ts => find_k_closest_elements.ts} | 0 solutions/find_k_closest_elements_test.ts | 17 + ...> find_minimum_in_rotated_sorted_array.ts} | 0 ...nd_minimum_in_rotated_sorted_array_test.ts | 12 + ...indPeakElement.ts => find_peak_element.ts} | 0 solutions/find_peak_element_test.ts | 10 + ...TheTownJudge.ts => find_the_town_judge.ts} | 0 solutions/find_the_town_judge_test.ts | 12 + solutions/firstBadVersion.test.ts | 10 - .../firstUniqueCharacterInAString.test.ts | 18 - ...irstBadVersion.ts => first_bad_version.ts} | 0 solutions/first_bad_version_test.ts | 10 + ... => first_unique_character_in_a_string.ts} | 4 +- ...first_unique_character_in_a_string_test.ts | 12 + solutions/fizzBuzz.test.ts | 40 - solutions/{fizzBuzz.ts => fizz_buzz.ts} | 4 +- solutions/fizz_buzz_test.ts | 31 + solutions/flipping_an_image.ts | 11 + solutions/flipping_an_image_test.ts | 20 + solutions/floodFill.test.ts | 47 - solutions/{floodFill.ts => flood_fill.ts} | 4 +- solutions/flood_fill_test.ts | 36 + solutions/happyNumber.test.ts | 11 - solutions/{happyNumber.ts => happy_number.ts} | 4 +- solutions/happy_number_test.ts | 8 + solutions/houseRobber.test.ts | 15 - solutions/{houseRobber.ts => house_robber.ts} | 4 +- solutions/house_robber_test.ts | 9 + solutions/implementStrstr.test.ts | 21 - ...implementStrstr.ts => implement_strstr.ts} | 4 +- solutions/implement_strstr_test.ts | 15 + solutions/intersectionOfTwoArrays.test.ts | 14 - solutions/intersectionOfTwoArrays2.test.ts | 147 - .../intersectionOfTwoLinkedLists.test.ts | 30 - ...rrays.ts => intersection_of_two_arrays.ts} | 7 +- ...ays2.ts => intersection_of_two_arrays2.ts} | 0 solutions/intersection_of_two_arrays2_test.ts | 141 + solutions/intersection_of_two_arrays_test.ts | 8 + ...ts => intersection_of_two_linked_lists.ts} | 2 +- .../intersection_of_two_linked_lists_test.ts | 30 + solutions/licenseKeyFormatting.test.ts | 14 - ...ormatting.ts => license_key_formatting.ts} | 4 +- solutions/license_key_formatting_test.ts | 8 + solutions/linkedListCycle.test.ts | 27 - ...inkedListCycle.ts => linked_list_cycle.ts} | 2 +- solutions/linked_list_cycle_test.ts | 25 + solutions/loggerRateLimiter.test.ts | 16 - ...rRateLimiter.ts => logger_rate_limiter.ts} | 4 +- solutions/logger_rate_limiter_test.ts | 14 + solutions/longestCommonPrefix.test.ts | 18 - ...mmonPrefix.ts => longest_common_prefix.ts} | 4 +- solutions/longest_common_prefix_test.ts | 12 + solutions/longest_mountain_in_array.ts | 34 + solutions/longest_mountain_in_array_test.ts | 11 + ...estPalindrome.ts => longest_palindrome.ts} | 0 ...ome.test.ts => longest_palindrome_test.ts} | 35 +- solutions/lruCache.test.ts | 56 - solutions/{lruCache.ts => lru_cache.ts} | 4 +- solutions/lru_cache_test.ts | 26 + solutions/majorityElement.test.ts | 11 - ...majorityElement.ts => majority_element.ts} | 0 solutions/majority_element_test.ts | 8 + solutions/maxAreaOfIsland.test.ts | 27 - ...xAreaOfIsland.ts => max_area_of_island.ts} | 0 solutions/max_area_of_island_test.ts | 27 + solutions/maximumDepthOfBinaryTree.test.ts | 12 - solutions/maximumLengthOfPairChain.test.ts | 15 - solutions/maximumSubarray.test.ts | 14 - ...ree.ts => maximum_depth_of_binary_tree.ts} | 2 +- .../maximum_depth_of_binary_tree_test.ts | 9 + ...ain.ts => maximum_length_of_pair_chain.ts} | 0 .../maximum_length_of_pair_chain_test.ts | 9 + ...maximumSubarray.ts => maximum_subarray.ts} | 4 +- solutions/maximum_subarray_test.ts | 8 + solutions/mergeSortedArray.test.ts | 23 - solutions/mergeTwoLists.test.ts | 20 - ...geSortedArray.ts => merge_sorted_array.ts} | 4 +- solutions/merge_sorted_array_test.ts | 13 + .../{mergeTwoLists.ts => merge_two_lists.ts} | 6 +- solutions/merge_two_lists_test.ts | 21 + solutions/minCostClimbingStairs.test.ts | 14 - solutions/minStack.test.ts | 14 - ...gStairs.ts => min_cost_climbing_stairs.ts} | 4 +- solutions/min_cost_climbing_stairs_test.ts | 8 + solutions/{minStack.ts => min_stack.ts} | 4 +- solutions/min_stack_test.ts | 14 + solutions/minimumDepthOfBinaryTree.test.ts | 18 - ...ree.ts => minimum_depth_of_binary_tree.ts} | 2 +- .../minimum_depth_of_binary_tree_test.ts | 12 + solutions/mostCommonWord.test.ts | 19 - ...{mostCommonWord.ts => most_common_word.ts} | 7 +- solutions/most_common_word_test.ts | 19 + solutions/moveZeroes.test.ts | 15 - solutions/{moveZeroes.ts => move_zeroes.ts} | 4 +- solutions/move_zeroes_test.ts | 11 + solutions/paintHouse.test.ts | 18 - solutions/{paintHouse.ts => paint_house.ts} | 4 +- solutions/paint_house_test.ts | 34 + solutions/palidromeNumber.test.ts | 19 - ...palidromeNumber.ts => palidrome_number.ts} | 4 +- solutions/palidrome_number_test.ts | 13 + solutions/palindromeLinkedList.test.ts | 17 - ...inkedList.ts => palindrome_linked_list.ts} | 2 +- solutions/palindrome_linked_list_test.ts | 15 + solutions/partitionEqualSubsetSum.test.ts | 15 - ...etSum.ts => partition_equal_subset_sum.ts} | 4 +- solutions/partition_equal_subset_sum_test.ts | 9 + solutions/pathSum.test.ts | 16 - solutions/{pathSum.ts => path_sum.ts} | 2 +- solutions/path_sum_test.ts | 48 + solutions/perfectNumber.test.ts | 17 - .../{perfectNumber.ts => perfect_number.ts} | 0 solutions/perfect_number_test.ts | 11 + solutions/plusOne.test.ts | 21 - solutions/{plusOne.ts => plus_one.ts} | 4 +- solutions/plus_one_test.ts | 15 + solutions/rangeSumQueryImmutable.test.ts | 134 - ...utable.ts => range_sum_query_immutable.ts} | 4 +- solutions/range_sum_query_immutable_test.ts | 774 +++ .../removeDuplicatesFromSortedArray.test.ts | 18 - ...=> remove_duplicates_from_sorted_array.ts} | 4 +- ...emove_duplicates_from_sorted_array_test.ts | 9 + solutions/reorderLogFiles.test.ts | 74 - ...eorderLogFiles.ts => reorder_log_files.ts} | 4 +- solutions/reorder_log_files_test.ts | 77 + solutions/reverseInteger.test.ts | 17 - solutions/reverseLinkedList.test.ts | 19 - solutions/reverseString.test.ts | 18 - .../{reverseInteger.ts => reverse_integer.ts} | 4 +- solutions/reverse_integer_test.ts | 11 + ...seLinkedList.ts => reverse_linked_list.ts} | 6 +- solutions/reverse_linked_list_test.ts | 23 + .../{reverseString.ts => reverse_string.ts} | 4 +- solutions/reverse_string_test.ts | 17 + solutions/romanToInteger.test.ts | 20 - ...{romanToInteger.ts => roman_to_integer.ts} | 4 +- solutions/roman_to_integer_test.ts | 14 + solutions/searchA2dMatrix2.test.ts | 40 - solutions/searchInRotatedSortedArray.test.ts | 17 - solutions/searchInsertPosition.test.ts | 16 - ...rchA2dMatrix2.ts => search_a2d_matrix2.ts} | 0 solutions/search_a2d_matrix2_test.ts | 30 + ...y.ts => search_in_rotated_sorted_array.ts} | 0 .../search_in_rotated_sorted_array_test.ts | 11 + ...tPosition.ts => search_insert_position.ts} | 0 solutions/search_insert_position_test.ts | 10 + solutions/sqrtx.test.ts | 19 - solutions/sqrtx_test.ts | 13 + solutions/strobogrammaticNumber.test.ts | 19 - ...ticNumber.ts => strobogrammatic_number.ts} | 4 +- solutions/strobogrammatic_number_test.ts | 13 + solutions/subsets.test.ts | 15 - solutions/subsets.ts | 4 +- solutions/subsets_test.ts | 10 + solutions/subtreeOfAnotherTree.test.ts | 47 - ...therTree.ts => subtree_of_another_tree.ts} | 2 +- solutions/subtree_of_another_tree_test.ts | 48 + solutions/symmetricTree.test.ts | 17 - .../{symmetricTree.ts => symmetric_tree.ts} | 8 +- solutions/symmetric_tree_test.ts | 15 + solutions/twoSum.test.ts | 14 - solutions/{twoSum.ts => two_sum.ts} | 7 +- solutions/two_sum_test.ts | 8 + solutions/uniqueEmailAddresses.test.ts | 28 - solutions/uniquePaths.test.ts | 11 - ...Addresses.ts => unique_email_addresses.ts} | 4 +- solutions/unique_email_addresses_test.ts | 20 + solutions/{uniquePaths.ts => unique_paths.ts} | 0 solutions/unique_paths_test.ts | 8 + solutions/validAnagram.test.ts | 15 - solutions/validPalindrome.test.ts | 16 - solutions/validParentheses.test.ts | 19 - .../{validAnagram.ts => valid_anagram.ts} | 0 solutions/valid_anagram_test.ts | 9 + ...validPalindrome.ts => valid_palindrome.ts} | 4 +- solutions/valid_palindrome_test.ts | 10 + ...lidParentheses.ts => valid_parentheses.ts} | 4 +- solutions/valid_parentheses_test.ts | 13 + solutions/validateBinarySearchTree.test.ts | 17 - ...Tree.ts => validate_binary_search_tree.ts} | 2 +- solutions/validate_binary_search_tree_test.ts | 13 + solutions/verifyingAnAlienDictionary.test.ts | 15 - ...ry.ts => verifying_an_alien_dictionary.ts} | 4 +- .../verifying_an_alien_dictionary_test.ts | 16 + testUtilities/BinaryTree.test.ts | 73 - testUtilities/LinkedList.test.ts | 96 - .../binary_tree.ts | 2 +- test_utilities/binary_tree_test.ts | 53 + .../linked_list.ts | 2 +- test_utilities/linked_list_test.ts | 67 + tsconfig.json | 21 - types/{BinaryTree.ts => binary_tree.ts} | 0 types/{LinkedList.ts => linked_list.ts} | 0 250 files changed, 2507 insertions(+), 7288 deletions(-) delete mode 100644 jest.config.js delete mode 100644 package-lock.json delete mode 100644 package.json delete mode 100644 solutions/addBinary.test.ts rename solutions/{addBinary.ts => add_binary.ts} (89%) create mode 100644 solutions/add_binary_test.ts delete mode 100644 solutions/backspaceStringCompare.test.ts rename solutions/{backspaceStringCompare.ts => backspace_string_compare.ts} (75%) create mode 100644 solutions/backspace_string_compare_test.ts delete mode 100644 solutions/bestTimeToBuyAndSellStock.test.ts rename solutions/{bestTimeToBuyAndSellStock.ts => best_time_to_buy_and_sell_stock.ts} (84%) create mode 100644 solutions/best_time_to_buy_and_sell_stock_test.ts delete mode 100644 solutions/binarySearch.test.ts delete mode 100644 solutions/binaryTreeInorderTraversal.test.ts delete mode 100644 solutions/binaryTreeLevelOrderTraversal.test.ts delete mode 100644 solutions/binaryTreePostorderTraversal.test.ts delete mode 100644 solutions/binaryTreePreorderTraversal.test.ts rename solutions/{binarySearch.ts => binary_search.ts} (100%) create mode 100644 solutions/binary_search_test.ts rename solutions/{binaryTreeInorderTraversal.ts => binary_tree_inorder_traversal.ts} (88%) create mode 100644 solutions/binary_tree_inorder_traversal_test.ts rename solutions/{binaryTreeLevelOrderTraversal.ts => binary_tree_level_order_traversal.ts} (91%) create mode 100644 solutions/binary_tree_level_order_traversal_test.ts rename solutions/{binaryTreePostorderTraversal.ts => binary_tree_postorder_traversal.ts} (88%) create mode 100644 solutions/binary_tree_postorder_traversal_test.ts rename solutions/{binaryTreePreorderTraversal.ts => binary_tree_preorder_traversal.ts} (88%) create mode 100644 solutions/binary_tree_preorder_traversal_test.ts delete mode 100644 solutions/bullsAndCows.test.ts rename solutions/{bullsAndCows.ts => bulls_and_cows.ts} (90%) create mode 100644 solutions/bulls_and_cows_test.ts delete mode 100644 solutions/climbingStairs.test.ts rename solutions/{climbingStairs.ts => climbing_stairs.ts} (79%) create mode 100644 solutions/climbing_stairs_test.ts delete mode 100644 solutions/countCompleteTreeNodes.test.ts delete mode 100644 solutions/countUnivalueSubtrees.test.ts rename solutions/{countAndSay.ts => count_and_say.ts} (90%) rename solutions/{countAndSay.test.ts => count_and_say_test.ts} (90%) rename solutions/{countCompleteTreeNodes.ts => count_complete_tree_nodes.ts} (84%) create mode 100644 solutions/count_complete_tree_nodes_test.ts rename solutions/{countUnivalueSubtrees.ts => count_univalue_subtrees.ts} (92%) create mode 100644 solutions/count_univalue_subtrees_test.ts delete mode 100644 solutions/diameterOfBinaryTree.test.ts rename solutions/{diameterOfBinaryTree.ts => diameter_of_binary_tree.ts} (92%) create mode 100644 solutions/diameter_of_binary_tree_test.ts create mode 100644 solutions/distance_between_bus_stops.ts create mode 100644 solutions/distance_between_bus_stops_test.ts delete mode 100644 solutions/findFirstAndLastPositionOfElementInSortedArray.test.ts delete mode 100644 solutions/findKClosestElements.test.ts delete mode 100644 solutions/findMinimumInRotatedSortedArray.test.ts delete mode 100644 solutions/findPeakElement.test.ts delete mode 100644 solutions/findTheTownJudge.test.ts rename solutions/{findAllAnagramsInAString.ts => find_all_anagrams_in_a_string.ts} (100%) rename solutions/{findAllAnagramsInAString.test.ts => find_all_anagrams_in_a_string_test.ts} (97%) rename solutions/{findFirstAndLastPositionOfElementInSortedArray.ts => find_first_and_last_position_of_element_in_sorted_array.ts} (100%) create mode 100644 solutions/find_first_and_last_position_of_element_in_sorted_array_test.ts rename solutions/{findKClosestElements.ts => find_k_closest_elements.ts} (100%) create mode 100644 solutions/find_k_closest_elements_test.ts rename solutions/{findMinimumInRotatedSortedArray.ts => find_minimum_in_rotated_sorted_array.ts} (100%) create mode 100644 solutions/find_minimum_in_rotated_sorted_array_test.ts rename solutions/{findPeakElement.ts => find_peak_element.ts} (100%) create mode 100644 solutions/find_peak_element_test.ts rename solutions/{findTheTownJudge.ts => find_the_town_judge.ts} (100%) create mode 100644 solutions/find_the_town_judge_test.ts delete mode 100644 solutions/firstBadVersion.test.ts delete mode 100644 solutions/firstUniqueCharacterInAString.test.ts rename solutions/{firstBadVersion.ts => first_bad_version.ts} (100%) create mode 100644 solutions/first_bad_version_test.ts rename solutions/{firstUniqueCharacterInAString.ts => first_unique_character_in_a_string.ts} (80%) create mode 100644 solutions/first_unique_character_in_a_string_test.ts delete mode 100644 solutions/fizzBuzz.test.ts rename solutions/{fizzBuzz.ts => fizz_buzz.ts} (84%) create mode 100644 solutions/fizz_buzz_test.ts create mode 100644 solutions/flipping_an_image.ts create mode 100644 solutions/flipping_an_image_test.ts delete mode 100644 solutions/floodFill.test.ts rename solutions/{floodFill.ts => flood_fill.ts} (95%) create mode 100644 solutions/flood_fill_test.ts delete mode 100644 solutions/happyNumber.test.ts rename solutions/{happyNumber.ts => happy_number.ts} (83%) create mode 100644 solutions/happy_number_test.ts delete mode 100644 solutions/houseRobber.test.ts rename solutions/{houseRobber.ts => house_robber.ts} (88%) create mode 100644 solutions/house_robber_test.ts delete mode 100644 solutions/implementStrstr.test.ts rename solutions/{implementStrstr.ts => implement_strstr.ts} (72%) create mode 100644 solutions/implement_strstr_test.ts delete mode 100644 solutions/intersectionOfTwoArrays.test.ts delete mode 100644 solutions/intersectionOfTwoArrays2.test.ts delete mode 100644 solutions/intersectionOfTwoLinkedLists.test.ts rename solutions/{intersectionOfTwoArrays.ts => intersection_of_two_arrays.ts} (77%) rename solutions/{intersectionOfTwoArrays2.ts => intersection_of_two_arrays2.ts} (100%) create mode 100644 solutions/intersection_of_two_arrays2_test.ts create mode 100644 solutions/intersection_of_two_arrays_test.ts rename solutions/{intersectionOfTwoLinkedLists.ts => intersection_of_two_linked_lists.ts} (86%) create mode 100644 solutions/intersection_of_two_linked_lists_test.ts delete mode 100644 solutions/licenseKeyFormatting.test.ts rename solutions/{licenseKeyFormatting.ts => license_key_formatting.ts} (79%) create mode 100644 solutions/license_key_formatting_test.ts delete mode 100644 solutions/linkedListCycle.test.ts rename solutions/{linkedListCycle.ts => linked_list_cycle.ts} (86%) create mode 100644 solutions/linked_list_cycle_test.ts delete mode 100644 solutions/loggerRateLimiter.test.ts rename solutions/{loggerRateLimiter.ts => logger_rate_limiter.ts} (92%) create mode 100644 solutions/logger_rate_limiter_test.ts delete mode 100644 solutions/longestCommonPrefix.test.ts rename solutions/{longestCommonPrefix.ts => longest_common_prefix.ts} (86%) create mode 100644 solutions/longest_common_prefix_test.ts create mode 100644 solutions/longest_mountain_in_array.ts create mode 100644 solutions/longest_mountain_in_array_test.ts rename solutions/{longestPalindrome.ts => longest_palindrome.ts} (100%) rename solutions/{longestPalindrome.test.ts => longest_palindrome_test.ts} (62%) delete mode 100644 solutions/lruCache.test.ts rename solutions/{lruCache.ts => lru_cache.ts} (95%) create mode 100644 solutions/lru_cache_test.ts delete mode 100644 solutions/majorityElement.test.ts rename solutions/{majorityElement.ts => majority_element.ts} (100%) create mode 100644 solutions/majority_element_test.ts delete mode 100644 solutions/maxAreaOfIsland.test.ts rename solutions/{maxAreaOfIsland.ts => max_area_of_island.ts} (100%) create mode 100644 solutions/max_area_of_island_test.ts delete mode 100644 solutions/maximumDepthOfBinaryTree.test.ts delete mode 100644 solutions/maximumLengthOfPairChain.test.ts delete mode 100644 solutions/maximumSubarray.test.ts rename solutions/{maximumDepthOfBinaryTree.ts => maximum_depth_of_binary_tree.ts} (82%) create mode 100644 solutions/maximum_depth_of_binary_tree_test.ts rename solutions/{maximumLengthOfPairChain.ts => maximum_length_of_pair_chain.ts} (100%) create mode 100644 solutions/maximum_length_of_pair_chain_test.ts rename solutions/{maximumSubarray.ts => maximum_subarray.ts} (79%) create mode 100644 solutions/maximum_subarray_test.ts delete mode 100644 solutions/mergeSortedArray.test.ts delete mode 100644 solutions/mergeTwoLists.test.ts rename solutions/{mergeSortedArray.ts => merge_sorted_array.ts} (94%) create mode 100644 solutions/merge_sorted_array_test.ts rename solutions/{mergeTwoLists.ts => merge_two_lists.ts} (79%) create mode 100644 solutions/merge_two_lists_test.ts delete mode 100644 solutions/minCostClimbingStairs.test.ts delete mode 100644 solutions/minStack.test.ts rename solutions/{minCostClimbingStairs.ts => min_cost_climbing_stairs.ts} (80%) create mode 100644 solutions/min_cost_climbing_stairs_test.ts rename solutions/{minStack.ts => min_stack.ts} (94%) create mode 100644 solutions/min_stack_test.ts delete mode 100644 solutions/minimumDepthOfBinaryTree.test.ts rename solutions/{minimumDepthOfBinaryTree.ts => minimum_depth_of_binary_tree.ts} (89%) create mode 100644 solutions/minimum_depth_of_binary_tree_test.ts delete mode 100644 solutions/mostCommonWord.test.ts rename solutions/{mostCommonWord.ts => most_common_word.ts} (87%) create mode 100644 solutions/most_common_word_test.ts delete mode 100644 solutions/moveZeroes.test.ts rename solutions/{moveZeroes.ts => move_zeroes.ts} (86%) create mode 100644 solutions/move_zeroes_test.ts delete mode 100644 solutions/paintHouse.test.ts rename solutions/{paintHouse.ts => paint_house.ts} (89%) create mode 100644 solutions/paint_house_test.ts delete mode 100644 solutions/palidromeNumber.test.ts rename solutions/{palidromeNumber.ts => palidrome_number.ts} (87%) create mode 100644 solutions/palidrome_number_test.ts delete mode 100644 solutions/palindromeLinkedList.test.ts rename solutions/{palindromeLinkedList.ts => palindrome_linked_list.ts} (90%) create mode 100644 solutions/palindrome_linked_list_test.ts delete mode 100644 solutions/partitionEqualSubsetSum.test.ts rename solutions/{partitionEqualSubsetSum.ts => partition_equal_subset_sum.ts} (85%) create mode 100644 solutions/partition_equal_subset_sum_test.ts delete mode 100644 solutions/pathSum.test.ts rename solutions/{pathSum.ts => path_sum.ts} (91%) create mode 100644 solutions/path_sum_test.ts delete mode 100644 solutions/perfectNumber.test.ts rename solutions/{perfectNumber.ts => perfect_number.ts} (100%) create mode 100644 solutions/perfect_number_test.ts delete mode 100644 solutions/plusOne.test.ts rename solutions/{plusOne.ts => plus_one.ts} (83%) create mode 100644 solutions/plus_one_test.ts delete mode 100644 solutions/rangeSumQueryImmutable.test.ts rename solutions/{rangeSumQueryImmutable.ts => range_sum_query_immutable.ts} (91%) create mode 100644 solutions/range_sum_query_immutable_test.ts delete mode 100644 solutions/removeDuplicatesFromSortedArray.test.ts rename solutions/{removeDuplicatesFromSortedArray.ts => remove_duplicates_from_sorted_array.ts} (85%) create mode 100644 solutions/remove_duplicates_from_sorted_array_test.ts delete mode 100644 solutions/reorderLogFiles.test.ts rename solutions/{reorderLogFiles.ts => reorder_log_files.ts} (93%) create mode 100644 solutions/reorder_log_files_test.ts delete mode 100644 solutions/reverseInteger.test.ts delete mode 100644 solutions/reverseLinkedList.test.ts delete mode 100644 solutions/reverseString.test.ts rename solutions/{reverseInteger.ts => reverse_integer.ts} (89%) create mode 100644 solutions/reverse_integer_test.ts rename solutions/{reverseLinkedList.ts => reverse_linked_list.ts} (79%) create mode 100644 solutions/reverse_linked_list_test.ts rename solutions/{reverseString.ts => reverse_string.ts} (77%) create mode 100644 solutions/reverse_string_test.ts delete mode 100644 solutions/romanToInteger.test.ts rename solutions/{romanToInteger.ts => roman_to_integer.ts} (91%) create mode 100644 solutions/roman_to_integer_test.ts delete mode 100644 solutions/searchA2dMatrix2.test.ts delete mode 100644 solutions/searchInRotatedSortedArray.test.ts delete mode 100644 solutions/searchInsertPosition.test.ts rename solutions/{searchA2dMatrix2.ts => search_a2d_matrix2.ts} (100%) create mode 100644 solutions/search_a2d_matrix2_test.ts rename solutions/{searchInRotatedSortedArray.ts => search_in_rotated_sorted_array.ts} (100%) create mode 100644 solutions/search_in_rotated_sorted_array_test.ts rename solutions/{searchInsertPosition.ts => search_insert_position.ts} (100%) create mode 100644 solutions/search_insert_position_test.ts delete mode 100644 solutions/sqrtx.test.ts create mode 100644 solutions/sqrtx_test.ts delete mode 100644 solutions/strobogrammaticNumber.test.ts rename solutions/{strobogrammaticNumber.ts => strobogrammatic_number.ts} (83%) create mode 100644 solutions/strobogrammatic_number_test.ts delete mode 100644 solutions/subsets.test.ts create mode 100644 solutions/subsets_test.ts delete mode 100644 solutions/subtreeOfAnotherTree.test.ts rename solutions/{subtreeOfAnotherTree.ts => subtree_of_another_tree.ts} (91%) create mode 100644 solutions/subtree_of_another_tree_test.ts delete mode 100644 solutions/symmetricTree.test.ts rename solutions/{symmetricTree.ts => symmetric_tree.ts} (82%) create mode 100644 solutions/symmetric_tree_test.ts delete mode 100644 solutions/twoSum.test.ts rename solutions/{twoSum.ts => two_sum.ts} (85%) create mode 100644 solutions/two_sum_test.ts delete mode 100644 solutions/uniqueEmailAddresses.test.ts delete mode 100644 solutions/uniquePaths.test.ts rename solutions/{uniqueEmailAddresses.ts => unique_email_addresses.ts} (77%) create mode 100644 solutions/unique_email_addresses_test.ts rename solutions/{uniquePaths.ts => unique_paths.ts} (100%) create mode 100644 solutions/unique_paths_test.ts delete mode 100644 solutions/validAnagram.test.ts delete mode 100644 solutions/validPalindrome.test.ts delete mode 100644 solutions/validParentheses.test.ts rename solutions/{validAnagram.ts => valid_anagram.ts} (100%) create mode 100644 solutions/valid_anagram_test.ts rename solutions/{validPalindrome.ts => valid_palindrome.ts} (90%) create mode 100644 solutions/valid_palindrome_test.ts rename solutions/{validParentheses.ts => valid_parentheses.ts} (91%) create mode 100644 solutions/valid_parentheses_test.ts delete mode 100644 solutions/validateBinarySearchTree.test.ts rename solutions/{validateBinarySearchTree.ts => validate_binary_search_tree.ts} (88%) create mode 100644 solutions/validate_binary_search_tree_test.ts delete mode 100644 solutions/verifyingAnAlienDictionary.test.ts rename solutions/{verifyingAnAlienDictionary.ts => verifying_an_alien_dictionary.ts} (91%) create mode 100644 solutions/verifying_an_alien_dictionary_test.ts delete mode 100644 testUtilities/BinaryTree.test.ts delete mode 100644 testUtilities/LinkedList.test.ts rename testUtilities/BinaryTree.ts => test_utilities/binary_tree.ts (94%) create mode 100644 test_utilities/binary_tree_test.ts rename testUtilities/LinkedList.ts => test_utilities/linked_list.ts (93%) create mode 100644 test_utilities/linked_list_test.ts delete mode 100644 tsconfig.json rename types/{BinaryTree.ts => binary_tree.ts} (100%) rename types/{LinkedList.ts => linked_list.ts} (100%) diff --git a/.gitignore b/.gitignore index 0a101d0..75ec3f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -node_modules/* .vscode/* \ No newline at end of file diff --git a/README.md b/README.md index 71d5059..f61e6cc 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,6 @@ # LeetCode Solutions in TypeScript - 🏃‍♀️ Enough small time and space complexity (not "minimum" because of no micro optimization) -- 💯 100% TypeScript +- 💯 Runs on [Deno](https://deno.land) (written in TypeScript) - ✅ Fully tested - 🗣 With helpful comments - -# Debugging on VSCode - -Install [📦ts-node](https://github.com/TypeStrong/ts-node) with `--no-save` and create `launch.json` like the following: - -``` -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Run the current TypeScript file", - "type": "node", - "request": "launch", - "protocol": "inspector", - "cwd": "${workspaceRoot}", - "args": ["${relativeFile}"], - "runtimeArgs": ["--nolazy", "-r", "ts-node/register"], - "sourceMaps": true - } - ] -} -``` - -Then run debug "Run the current TypeScript file". diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 3f878c4..0000000 --- a/jest.config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: "ts-jest", - testEnvironment: "node" -}; diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 32c5885..0000000 --- a/package-lock.json +++ /dev/null @@ -1,5051 +0,0 @@ -{ - "name": "leetnode", - "version": "0.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/core": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.5.5.tgz", - "integrity": "sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helpers": "^7.5.5", - "@babel/parser": "^7.5.5", - "@babel/template": "^7.4.4", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5", - "convert-source-map": "^1.1.0", - "debug": "^4.1.0", - "json5": "^2.1.0", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz", - "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==", - "dev": true, - "requires": { - "@babel/types": "^7.5.5", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", - "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", - "dev": true - }, - "@babel/helper-split-export-declaration": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", - "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", - "dev": true, - "requires": { - "@babel/types": "^7.4.4" - } - }, - "@babel/helpers": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.5.5.tgz", - "integrity": "sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g==", - "dev": true, - "requires": { - "@babel/template": "^7.4.4", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5" - } - }, - "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz", - "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==", - "dev": true - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz", - "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", - "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" - } - }, - "@babel/traverse": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz", - "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "@babel/types": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz", - "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "@cnakazawa/watch": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz", - "integrity": "sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==", - "dev": true, - "requires": { - "exec-sh": "^0.3.2", - "minimist": "^1.2.0" - } - }, - "@jest/console": { - "version": "24.7.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz", - "integrity": "sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==", - "dev": true, - "requires": { - "@jest/source-map": "^24.3.0", - "chalk": "^2.0.1", - "slash": "^2.0.0" - } - }, - "@jest/core": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.8.0.tgz", - "integrity": "sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A==", - "dev": true, - "requires": { - "@jest/console": "^24.7.1", - "@jest/reporters": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "graceful-fs": "^4.1.15", - "jest-changed-files": "^24.8.0", - "jest-config": "^24.8.0", - "jest-haste-map": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-regex-util": "^24.3.0", - "jest-resolve-dependencies": "^24.8.0", - "jest-runner": "^24.8.0", - "jest-runtime": "^24.8.0", - "jest-snapshot": "^24.8.0", - "jest-util": "^24.8.0", - "jest-validate": "^24.8.0", - "jest-watcher": "^24.8.0", - "micromatch": "^3.1.10", - "p-each-series": "^1.0.0", - "pirates": "^4.0.1", - "realpath-native": "^1.1.0", - "rimraf": "^2.5.4", - "strip-ansi": "^5.0.0" - } - }, - "@jest/environment": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.8.0.tgz", - "integrity": "sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw==", - "dev": true, - "requires": { - "@jest/fake-timers": "^24.8.0", - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", - "jest-mock": "^24.8.0" - } - }, - "@jest/fake-timers": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.8.0.tgz", - "integrity": "sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-mock": "^24.8.0" - } - }, - "@jest/reporters": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.8.0.tgz", - "integrity": "sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw==", - "dev": true, - "requires": { - "@jest/environment": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "glob": "^7.1.2", - "istanbul-lib-coverage": "^2.0.2", - "istanbul-lib-instrument": "^3.0.1", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.1", - "istanbul-reports": "^2.1.1", - "jest-haste-map": "^24.8.0", - "jest-resolve": "^24.8.0", - "jest-runtime": "^24.8.0", - "jest-util": "^24.8.0", - "jest-worker": "^24.6.0", - "node-notifier": "^5.2.1", - "slash": "^2.0.0", - "source-map": "^0.6.0", - "string-length": "^2.0.0" - } - }, - "@jest/source-map": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-24.3.0.tgz", - "integrity": "sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag==", - "dev": true, - "requires": { - "callsites": "^3.0.0", - "graceful-fs": "^4.1.15", - "source-map": "^0.6.0" - } - }, - "@jest/test-result": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.8.0.tgz", - "integrity": "sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng==", - "dev": true, - "requires": { - "@jest/console": "^24.7.1", - "@jest/types": "^24.8.0", - "@types/istanbul-lib-coverage": "^2.0.0" - } - }, - "@jest/test-sequencer": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz", - "integrity": "sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg==", - "dev": true, - "requires": { - "@jest/test-result": "^24.8.0", - "jest-haste-map": "^24.8.0", - "jest-runner": "^24.8.0", - "jest-runtime": "^24.8.0" - } - }, - "@jest/transform": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.8.0.tgz", - "integrity": "sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA==", - "dev": true, - "requires": { - "@babel/core": "^7.1.0", - "@jest/types": "^24.8.0", - "babel-plugin-istanbul": "^5.1.0", - "chalk": "^2.0.1", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.1.15", - "jest-haste-map": "^24.8.0", - "jest-regex-util": "^24.3.0", - "jest-util": "^24.8.0", - "micromatch": "^3.1.10", - "realpath-native": "^1.1.0", - "slash": "^2.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "2.4.1" - } - }, - "@jest/types": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", - "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^12.0.9" - } - }, - "@types/babel__core": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.2.tgz", - "integrity": "sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "@types/babel__generator": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.0.2.tgz", - "integrity": "sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@types/babel__template": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz", - "integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@types/babel__traverse": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.7.tgz", - "integrity": "sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw==", - "dev": true, - "requires": { - "@babel/types": "^7.3.0" - } - }, - "@types/istanbul-lib-coverage": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", - "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==", - "dev": true - }, - "@types/istanbul-lib-report": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", - "integrity": "sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*" - } - }, - "@types/istanbul-reports": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz", - "integrity": "sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - }, - "@types/jest": { - "version": "24.0.17", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.17.tgz", - "integrity": "sha512-1cy3xkOAfSYn78dsBWy4M3h/QF/HeWPchNFDjysVtp3GHeTdSmtluNnELfCmfNRRHo0OWEcpf+NsEJQvwQfdqQ==", - "dev": true, - "requires": { - "@types/jest-diff": "*" - } - }, - "@types/jest-diff": { - "version": "20.0.1", - "resolved": "https://registry.npmjs.org/@types/jest-diff/-/jest-diff-20.0.1.tgz", - "integrity": "sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==", - "dev": true - }, - "@types/stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", - "dev": true - }, - "@types/yargs": { - "version": "12.0.12", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz", - "integrity": "sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==", - "dev": true - }, - "abab": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", - "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", - "dev": true - }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - }, - "acorn-globals": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.3.tgz", - "integrity": "sha512-vkR40VwS2SYO98AIeFvzWWh+xyc2qi9s7OoXSFEGIP/rOJKzjnhykaZJNnHdoq4BL2gGxI5EZOU16z896EYnOQ==", - "dev": true, - "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - }, - "dependencies": { - "acorn": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.1.tgz", - "integrity": "sha512-JD0xT5FCRDNyjDda3Lrg/IxFscp9q4tiYtxE1/nOzlKCk7hIRuYjhq1kCNkbPjMRMZuFq20HNQn1I9k8Oj0E+Q==", - "dev": true - } - } - }, - "acorn-walk": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", - "dev": true - }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", - "dev": true - }, - "babel-jest": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.8.0.tgz", - "integrity": "sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw==", - "dev": true, - "requires": { - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", - "@types/babel__core": "^7.1.0", - "babel-plugin-istanbul": "^5.1.0", - "babel-preset-jest": "^24.6.0", - "chalk": "^2.4.2", - "slash": "^2.0.0" - } - }, - "babel-plugin-istanbul": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz", - "integrity": "sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "find-up": "^3.0.0", - "istanbul-lib-instrument": "^3.3.0", - "test-exclude": "^5.2.3" - } - }, - "babel-plugin-jest-hoist": { - "version": "24.6.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz", - "integrity": "sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w==", - "dev": true, - "requires": { - "@types/babel__traverse": "^7.0.6" - } - }, - "babel-preset-jest": { - "version": "24.6.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz", - "integrity": "sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw==", - "dev": true, - "requires": { - "@babel/plugin-syntax-object-rest-spread": "^7.0.0", - "babel-plugin-jest-hoist": "^24.6.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", - "dev": true - }, - "browser-resolve": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", - "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", - "dev": true, - "requires": { - "resolve": "1.1.7" - }, - "dependencies": { - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - } - } - }, - "bs-logger": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", - "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", - "dev": true, - "requires": { - "fast-json-stable-stringify": "2.x" - } - }, - "bser": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.0.tgz", - "integrity": "sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg==", - "dev": true, - "requires": { - "node-int64": "^0.4.0" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "capture-exit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", - "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", - "dev": true, - "requires": { - "rsvp": "^4.8.4" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true, - "optional": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - }, - "cssstyle": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz", - "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==", - "dev": true, - "requires": { - "cssom": "0.3.x" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "data-urls": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", - "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "whatwg-mimetype": "^2.2.0", - "whatwg-url": "^7.0.0" - }, - "dependencies": { - "whatwg-url": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", - "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - } - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "detect-newline": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true - }, - "diff-sequences": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", - "integrity": "sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==", - "dev": true - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.0", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", - "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - } - }, - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "exec-sh": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz", - "integrity": "sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==", - "dev": true - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "expect": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-24.8.0.tgz", - "integrity": "sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-styles": "^3.2.0", - "jest-get-type": "^24.8.0", - "jest-matcher-utils": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-regex-util": "^24.3.0" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fb-watchman": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", - "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", - "dev": true, - "requires": { - "bser": "^2.0.0" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "graceful-fs": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.1.tgz", - "integrity": "sha512-b9usnbDGnD928gJB3LrCmxoibr3VE4U2SMo5PBuBnokWyDADTqDPXg4YpwKF1trpH+UbGp7QLicO3+aWEy0+mw==", - "dev": true - }, - "growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", - "dev": true - }, - "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", - "dev": true, - "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hosted-git-info": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.2.tgz", - "integrity": "sha512-CyjlXII6LMsPMyUzxpTt8fzh5QwzGqPmQXgY/Jyf4Zfp27t/FvfhwoE/8laaMUcMy816CkWF20I7NeQhwwY88w==", - "dev": true, - "requires": { - "lru-cache": "^5.1.1" - } - }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "dev": true, - "requires": { - "whatwg-encoding": "^1.0.1" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", - "dev": true, - "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", - "dev": true - }, - "istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", - "dev": true, - "requires": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "istanbul-lib-report": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", - "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "supports-color": "^6.1.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", - "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "rimraf": "^2.6.3", - "source-map": "^0.6.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "istanbul-reports": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", - "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", - "dev": true, - "requires": { - "handlebars": "^4.1.2" - } - }, - "jest": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz", - "integrity": "sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg==", - "dev": true, - "requires": { - "import-local": "^2.0.0", - "jest-cli": "^24.8.0" - }, - "dependencies": { - "jest-cli": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.8.0.tgz", - "integrity": "sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA==", - "dev": true, - "requires": { - "@jest/core": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "import-local": "^2.0.0", - "is-ci": "^2.0.0", - "jest-config": "^24.8.0", - "jest-util": "^24.8.0", - "jest-validate": "^24.8.0", - "prompts": "^2.0.1", - "realpath-native": "^1.1.0", - "yargs": "^12.0.2" - } - } - } - }, - "jest-changed-files": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.8.0.tgz", - "integrity": "sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "execa": "^1.0.0", - "throat": "^4.0.0" - } - }, - "jest-config": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.8.0.tgz", - "integrity": "sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw==", - "dev": true, - "requires": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^24.8.0", - "@jest/types": "^24.8.0", - "babel-jest": "^24.8.0", - "chalk": "^2.0.1", - "glob": "^7.1.1", - "jest-environment-jsdom": "^24.8.0", - "jest-environment-node": "^24.8.0", - "jest-get-type": "^24.8.0", - "jest-jasmine2": "^24.8.0", - "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.8.0", - "jest-util": "^24.8.0", - "jest-validate": "^24.8.0", - "micromatch": "^3.1.10", - "pretty-format": "^24.8.0", - "realpath-native": "^1.1.0" - } - }, - "jest-diff": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.8.0.tgz", - "integrity": "sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==", - "dev": true, - "requires": { - "chalk": "^2.0.1", - "diff-sequences": "^24.3.0", - "jest-get-type": "^24.8.0", - "pretty-format": "^24.8.0" - } - }, - "jest-docblock": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.3.0.tgz", - "integrity": "sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg==", - "dev": true, - "requires": { - "detect-newline": "^2.1.0" - } - }, - "jest-each": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.8.0.tgz", - "integrity": "sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "chalk": "^2.0.1", - "jest-get-type": "^24.8.0", - "jest-util": "^24.8.0", - "pretty-format": "^24.8.0" - } - }, - "jest-environment-jsdom": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz", - "integrity": "sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ==", - "dev": true, - "requires": { - "@jest/environment": "^24.8.0", - "@jest/fake-timers": "^24.8.0", - "@jest/types": "^24.8.0", - "jest-mock": "^24.8.0", - "jest-util": "^24.8.0", - "jsdom": "^11.5.1" - } - }, - "jest-environment-node": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.8.0.tgz", - "integrity": "sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q==", - "dev": true, - "requires": { - "@jest/environment": "^24.8.0", - "@jest/fake-timers": "^24.8.0", - "@jest/types": "^24.8.0", - "jest-mock": "^24.8.0", - "jest-util": "^24.8.0" - } - }, - "jest-get-type": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", - "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", - "dev": true - }, - "jest-haste-map": { - "version": "24.8.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.8.1.tgz", - "integrity": "sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "anymatch": "^2.0.0", - "fb-watchman": "^2.0.0", - "fsevents": "^1.2.7", - "graceful-fs": "^4.1.15", - "invariant": "^2.2.4", - "jest-serializer": "^24.4.0", - "jest-util": "^24.8.0", - "jest-worker": "^24.6.0", - "micromatch": "^3.1.10", - "sane": "^4.0.3", - "walker": "^1.0.7" - } - }, - "jest-jasmine2": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz", - "integrity": "sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong==", - "dev": true, - "requires": { - "@babel/traverse": "^7.1.0", - "@jest/environment": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", - "chalk": "^2.0.1", - "co": "^4.6.0", - "expect": "^24.8.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^24.8.0", - "jest-matcher-utils": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-runtime": "^24.8.0", - "jest-snapshot": "^24.8.0", - "jest-util": "^24.8.0", - "pretty-format": "^24.8.0", - "throat": "^4.0.0" - } - }, - "jest-leak-detector": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz", - "integrity": "sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g==", - "dev": true, - "requires": { - "pretty-format": "^24.8.0" - } - }, - "jest-matcher-utils": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz", - "integrity": "sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw==", - "dev": true, - "requires": { - "chalk": "^2.0.1", - "jest-diff": "^24.8.0", - "jest-get-type": "^24.8.0", - "pretty-format": "^24.8.0" - } - }, - "jest-message-util": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.8.0.tgz", - "integrity": "sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", - "@types/stack-utils": "^1.0.1", - "chalk": "^2.0.1", - "micromatch": "^3.1.10", - "slash": "^2.0.0", - "stack-utils": "^1.0.1" - } - }, - "jest-mock": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.8.0.tgz", - "integrity": "sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0" - } - }, - "jest-pnp-resolver": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", - "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", - "dev": true - }, - "jest-regex-util": { - "version": "24.3.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.3.0.tgz", - "integrity": "sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg==", - "dev": true - }, - "jest-resolve": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.8.0.tgz", - "integrity": "sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "browser-resolve": "^1.11.3", - "chalk": "^2.0.1", - "jest-pnp-resolver": "^1.2.1", - "realpath-native": "^1.1.0" - } - }, - "jest-resolve-dependencies": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz", - "integrity": "sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "jest-regex-util": "^24.3.0", - "jest-snapshot": "^24.8.0" - } - }, - "jest-runner": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.8.0.tgz", - "integrity": "sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow==", - "dev": true, - "requires": { - "@jest/console": "^24.7.1", - "@jest/environment": "^24.8.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", - "chalk": "^2.4.2", - "exit": "^0.1.2", - "graceful-fs": "^4.1.15", - "jest-config": "^24.8.0", - "jest-docblock": "^24.3.0", - "jest-haste-map": "^24.8.0", - "jest-jasmine2": "^24.8.0", - "jest-leak-detector": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-resolve": "^24.8.0", - "jest-runtime": "^24.8.0", - "jest-util": "^24.8.0", - "jest-worker": "^24.6.0", - "source-map-support": "^0.5.6", - "throat": "^4.0.0" - } - }, - "jest-runtime": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.8.0.tgz", - "integrity": "sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA==", - "dev": true, - "requires": { - "@jest/console": "^24.7.1", - "@jest/environment": "^24.8.0", - "@jest/source-map": "^24.3.0", - "@jest/transform": "^24.8.0", - "@jest/types": "^24.8.0", - "@types/yargs": "^12.0.2", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.1.15", - "jest-config": "^24.8.0", - "jest-haste-map": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-mock": "^24.8.0", - "jest-regex-util": "^24.3.0", - "jest-resolve": "^24.8.0", - "jest-snapshot": "^24.8.0", - "jest-util": "^24.8.0", - "jest-validate": "^24.8.0", - "realpath-native": "^1.1.0", - "slash": "^2.0.0", - "strip-bom": "^3.0.0", - "yargs": "^12.0.2" - } - }, - "jest-serializer": { - "version": "24.4.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.4.0.tgz", - "integrity": "sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q==", - "dev": true - }, - "jest-snapshot": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.8.0.tgz", - "integrity": "sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0", - "@jest/types": "^24.8.0", - "chalk": "^2.0.1", - "expect": "^24.8.0", - "jest-diff": "^24.8.0", - "jest-matcher-utils": "^24.8.0", - "jest-message-util": "^24.8.0", - "jest-resolve": "^24.8.0", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "pretty-format": "^24.8.0", - "semver": "^5.5.0" - } - }, - "jest-util": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.8.0.tgz", - "integrity": "sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA==", - "dev": true, - "requires": { - "@jest/console": "^24.7.1", - "@jest/fake-timers": "^24.8.0", - "@jest/source-map": "^24.3.0", - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", - "callsites": "^3.0.0", - "chalk": "^2.0.1", - "graceful-fs": "^4.1.15", - "is-ci": "^2.0.0", - "mkdirp": "^0.5.1", - "slash": "^2.0.0", - "source-map": "^0.6.0" - } - }, - "jest-validate": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", - "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "camelcase": "^5.0.0", - "chalk": "^2.0.1", - "jest-get-type": "^24.8.0", - "leven": "^2.1.0", - "pretty-format": "^24.8.0" - } - }, - "jest-watcher": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.8.0.tgz", - "integrity": "sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw==", - "dev": true, - "requires": { - "@jest/test-result": "^24.8.0", - "@jest/types": "^24.8.0", - "@types/yargs": "^12.0.9", - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.1", - "jest-util": "^24.8.0", - "string-length": "^2.0.0" - } - }, - "jest-worker": { - "version": "24.6.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz", - "integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==", - "dev": true, - "requires": { - "merge-stream": "^1.0.1", - "supports-color": "^6.1.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsdom": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", - "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "acorn": "^5.5.3", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": "^1.0.0", - "data-urls": "^1.0.0", - "domexception": "^1.0.1", - "escodegen": "^1.9.1", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.3.0", - "nwsapi": "^2.0.7", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.87.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.4", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-mimetype": "^2.1.0", - "whatwg-url": "^6.4.1", - "ws": "^5.2.0", - "xml-name-validator": "^3.0.0" - } - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", - "dev": true - }, - "leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", - "dev": true - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - }, - "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - } - } - }, - "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", - "dev": true - }, - "makeerror": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", - "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", - "dev": true, - "requires": { - "tmpl": "1.0.x" - } - }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", - "dev": true - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "dev": true, - "requires": { - "mime-db": "1.40.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true - }, - "node-notifier": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.1.tgz", - "integrity": "sha512-p52B+onAEHKW1OF9MGO/S7k/ahGEHfhP5/tvwYzog/5XLYOd8ZuD6vdNZdUuWMONRnKPneXV43v3s6Snx1wsCQ==", - "dev": true, - "requires": { - "growly": "^1.3.0", - "is-wsl": "^1.1.0", - "semver": "^5.5.0", - "shellwords": "^0.1.1", - "which": "^1.3.0" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "nwsapi": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", - "integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - } - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - }, - "dependencies": { - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - } - } - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-each-series": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", - "integrity": "sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=", - "dev": true, - "requires": { - "p-reduce": "^1.0.0" - } - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", - "dev": true - }, - "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-reduce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", - "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", - "dev": true - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", - "dev": true, - "requires": { - "node-modules-regexp": "^1.0.0" - } - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", - "dev": true - }, - "pretty-format": { - "version": "24.8.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", - "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", - "dev": true, - "requires": { - "@jest/types": "^24.8.0", - "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0", - "react-is": "^16.8.4" - } - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "prompts": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.2.1.tgz", - "integrity": "sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw==", - "dev": true, - "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.3" - } - }, - "psl": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", - "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==", - "dev": true - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "react-is": { - "version": "16.8.6", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", - "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", - "dev": true, - "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "realpath-native": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz", - "integrity": "sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==", - "dev": true, - "requires": { - "util.promisify": "^1.0.0" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - } - } - }, - "request-promise-core": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", - "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - }, - "request-promise-native": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", - "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", - "dev": true, - "requires": { - "request-promise-core": "1.1.2", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "rsvp": { - "version": "4.8.5", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", - "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sane": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", - "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", - "dev": true, - "requires": { - "@cnakazawa/watch": "^1.0.3", - "anymatch": "^2.0.0", - "capture-exit": "^2.0.0", - "exec-sh": "^0.3.2", - "execa": "^1.0.0", - "fb-watchman": "^2.0.0", - "micromatch": "^3.1.4", - "minimist": "^1.1.1", - "walker": "~1.0.5" - } - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "sisteransi": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.3.tgz", - "integrity": "sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg==", - "dev": true - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", - "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", - "dev": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true - }, - "string-length": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", - "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", - "dev": true, - "requires": { - "astral-regex": "^1.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "test-exclude": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", - "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", - "dev": true, - "requires": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^2.0.0" - } - }, - "throat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", - "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", - "dev": true - }, - "tmpl": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", - "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", - "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, - "ts-jest": { - "version": "24.0.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz", - "integrity": "sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw==", - "dev": true, - "requires": { - "bs-logger": "0.x", - "buffer-from": "1.x", - "fast-json-stable-stringify": "2.x", - "json5": "2.x", - "make-error": "1.x", - "mkdirp": "0.x", - "resolve": "1.x", - "semver": "^5.5", - "yargs-parser": "10.x" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "typescript": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz", - "integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==", - "dev": true - }, - "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", - "dev": true, - "optional": true, - "requires": { - "commander": "~2.20.0", - "source-map": "~0.6.1" - } - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "object.getownpropertydescriptors": "^2.0.3" - } - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", - "dev": true, - "requires": { - "browser-process-hrtime": "^0.1.2" - } - }, - "walker": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", - "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", - "dev": true, - "requires": { - "makeerror": "1.0.x" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "whatwg-url": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write-file-atomic": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz", - "integrity": "sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - }, - "dependencies": { - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - } - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index f1f1433..0000000 --- a/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "leetnode", - "version": "0.0.0", - "description": "", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "@types/jest": "^24.0.17", - "jest": "^24.8.0", - "prettier": "^1.18.2", - "ts-jest": "^24.0.2", - "typescript": "^3.6.3" - }, - "scripts": { - "test": "jest --notify --verbose" - }, - "author": "Kohei Asai (https://axross.io/)", - "license": "MIT" -} diff --git a/solutions/addBinary.test.ts b/solutions/addBinary.test.ts deleted file mode 100644 index 99f0abb..0000000 --- a/solutions/addBinary.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import addBinary from "./addBinary"; - -describe("67. Add Binary", () => { - const TEST_CASES = new Map([ - [["11", "1"], "100"], - [["1010", "1011"], "10101"] - ]); - - for (const [[a, b], expected] of TEST_CASES) { - it(`returns ${expected} when called with ${a} and ${b}`, () => { - expect(addBinary(a, b)).toBe(expected); - }); - } -}); diff --git a/solutions/addBinary.ts b/solutions/add_binary.ts similarity index 89% rename from solutions/addBinary.ts rename to solutions/add_binary.ts index 31486d3..194946d 100644 --- a/solutions/addBinary.ts +++ b/solutions/add_binary.ts @@ -1,6 +1,6 @@ // 67. Add Binary // https://leetcode.com/problems/add-binary/ -function addBinary(a: string, b: string): string { +export default function addBinary(a: string, b: string): string { let result = ""; let isCarrying = false; @@ -22,5 +22,3 @@ function addBinary(a: string, b: string): string { return isCarrying ? "1" + result : result; } - -export default addBinary; diff --git a/solutions/add_binary_test.ts b/solutions/add_binary_test.ts new file mode 100644 index 0000000..1b8dfd8 --- /dev/null +++ b/solutions/add_binary_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import addBinary from "./add_binary.ts"; + +test("67. Add Binary", () => { + assert(addBinary("11", "1") === "100"); + assert(addBinary("1010", "1011") === "10101"); +}); diff --git a/solutions/backspaceStringCompare.test.ts b/solutions/backspaceStringCompare.test.ts deleted file mode 100644 index a8bf9c3..0000000 --- a/solutions/backspaceStringCompare.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import backspaceCompare from "./backspaceStringCompare"; - -describe("844. Backspace String Compare", () => { - const TEST_CASES = new Map([ - [["ab#c", "ad#c"], true], - [["ab##", "c#d#"], true], - [["a##c", "#a#c"], true], - [["a#c", "b"], false] - ]); - - for (const [[s, t], expected] of TEST_CASES) { - it(`returns ${expected} when called with ${s} and ${t}`, () => { - expect(backspaceCompare(s, t)).toBe(expected); - }); - } -}); diff --git a/solutions/backspaceStringCompare.ts b/solutions/backspace_string_compare.ts similarity index 75% rename from solutions/backspaceStringCompare.ts rename to solutions/backspace_string_compare.ts index 47f2cfe..7d9c46d 100644 --- a/solutions/backspaceStringCompare.ts +++ b/solutions/backspace_string_compare.ts @@ -1,6 +1,6 @@ // 844. Backspace String Compare // https://leetcode.com/problems/backspace-string-compare/ -function backspaceCompare(S: string, T: string): boolean { +export default function backspaceCompare(S: string, T: string): boolean { let s = S; let t = T; @@ -14,5 +14,3 @@ function backspaceCompare(S: string, T: string): boolean { return s === t; } - -export default backspaceCompare; diff --git a/solutions/backspace_string_compare_test.ts b/solutions/backspace_string_compare_test.ts new file mode 100644 index 0000000..705fa8e --- /dev/null +++ b/solutions/backspace_string_compare_test.ts @@ -0,0 +1,10 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import backspaceCompare from "./backspace_string_compare.ts"; + +test("844. Backspace String Compare", () => { + assert(backspaceCompare("ab#c", "ad#c") === true); + assert(backspaceCompare("ab##", "c#d#") === true); + assert(backspaceCompare("a##c", "#a#c") === true); + assert(backspaceCompare("a#c", "b") === false); +}); diff --git a/solutions/bestTimeToBuyAndSellStock.test.ts b/solutions/bestTimeToBuyAndSellStock.test.ts deleted file mode 100644 index d5947dd..0000000 --- a/solutions/bestTimeToBuyAndSellStock.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import maxProfit from "./bestTimeToBuyAndSellStock"; - -describe("121. Best Time to Buy and Sell Stock", () => { - const TEST_CASES = new Map([ - [[7, 1, 5, 3, 6, 4], 5], - [[7, 6, 4, 3, 1], 0], - [[7, 6, 5, 2, 3, 4, 1], 2], - [[7, 3, 8, 1, 2, 5, 4], 5] - ]); - - for (const [prices, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${prices}]`, () => { - expect(maxProfit(prices)).toBe(expected); - }); - } -}); diff --git a/solutions/bestTimeToBuyAndSellStock.ts b/solutions/best_time_to_buy_and_sell_stock.ts similarity index 84% rename from solutions/bestTimeToBuyAndSellStock.ts rename to solutions/best_time_to_buy_and_sell_stock.ts index 7c715fe..4323a85 100644 --- a/solutions/bestTimeToBuyAndSellStock.ts +++ b/solutions/best_time_to_buy_and_sell_stock.ts @@ -1,6 +1,6 @@ // 121. Best Time to Buy and Sell Stock // https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ -function maxProfit(prices: number[]): number { +export default function maxProfit(prices: number[]): number { let maxProfit = 0; let minPrice = Number.MAX_SAFE_INTEGER; @@ -14,5 +14,3 @@ function maxProfit(prices: number[]): number { return maxProfit; } - -export default maxProfit; diff --git a/solutions/best_time_to_buy_and_sell_stock_test.ts b/solutions/best_time_to_buy_and_sell_stock_test.ts new file mode 100644 index 0000000..1705444 --- /dev/null +++ b/solutions/best_time_to_buy_and_sell_stock_test.ts @@ -0,0 +1,10 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import maxProfit from "./best_time_to_buy_and_sell_stock.ts"; + +test("121. Best Time to Buy and Sell Stock", () => { + assert(maxProfit([7, 1, 5, 3, 6, 4]) === 5); + assert(maxProfit([7, 6, 4, 3, 1]) === 0); + assert(maxProfit([7, 6, 5, 2, 3, 4, 1]) === 2); + assert(maxProfit([7, 3, 8, 1, 2, 5, 4]) === 5); +}); diff --git a/solutions/binarySearch.test.ts b/solutions/binarySearch.test.ts deleted file mode 100644 index 1f7a2b6..0000000 --- a/solutions/binarySearch.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import search from "./binarySearch"; - -describe("704. Binary Search", () => { - const TEST_CASES = new Map<[number[], number], number>([ - [[[-1, 0, 3, 5, 9, 12], 9], 4], - [[[-1, 0, 3, 5, 9, 12], 13], -1] - ]); - - for (const [[nums, target], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${nums}] and ${target}`, () => { - expect(search(nums, target)).toBe(expected); - }); - } -}); diff --git a/solutions/binaryTreeInorderTraversal.test.ts b/solutions/binaryTreeInorderTraversal.test.ts deleted file mode 100644 index 06fc897..0000000 --- a/solutions/binaryTreeInorderTraversal.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import inorderTraversal from "./binaryTreeInorderTraversal"; - -describe("94. Binary Tree Inorder Traversal", () => { - const TEST_CASES = new Map([ - [[1, null, 2, 3], [1, 3, 2]], - [[4, 4, 5, 1, 2], [1, 4, 2, 4, 5]], - [ - [1, null, 1, null, 1, null, 1, null, 1, null, 1, 2], - [1, 1, 1, 1, 1, 2, 1] - ], - [[1], [1]], - [[], []] - ]); - - for (const [tree, expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${tree}]`, () => { - expect(inorderTraversal(createBinaryTreeNode(tree))).toEqual(expected); - }); - } -}); diff --git a/solutions/binaryTreeLevelOrderTraversal.test.ts b/solutions/binaryTreeLevelOrderTraversal.test.ts deleted file mode 100644 index 5bc229c..0000000 --- a/solutions/binaryTreeLevelOrderTraversal.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import levelOrder from "./binaryTreeLevelOrderTraversal"; - -describe("102. Binary Tree Level Order Traversal", () => { - const TEST_CASES = new Map([ - [[1, null, 2, 3], [[1], [2], [3]]], - [[4, 4, 5, 1, 2], [[4], [4, 5], [1, 2]]], - [ - [1, null, 1, null, 1, null, 1, null, 1, null, 1, 2], - [[1], [1], [1], [1], [1], [1], [2]] - ], - [[1], [[1]]], - [[], []] - ]); - - for (const [tree, expected] of TEST_CASES) { - it(`returns [${expected.map( - level => `[${level}]` - )}] when called with [${tree}]`, () => { - expect(levelOrder(createBinaryTreeNode(tree))).toEqual(expected); - }); - } -}); diff --git a/solutions/binaryTreePostorderTraversal.test.ts b/solutions/binaryTreePostorderTraversal.test.ts deleted file mode 100644 index 14f466d..0000000 --- a/solutions/binaryTreePostorderTraversal.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import postorderTraversal from "./binaryTreePostorderTraversal"; - -describe("145. Binary Tree Postorder Traversal", () => { - const TEST_CASES = new Map([ - [[1, null, 2, 3], [3, 2, 1]], - [[4, 4, 5, 1, 2], [1, 2, 4, 5, 4]], - [ - [1, null, 1, null, 1, null, 1, null, 1, null, 1, 2], - [2, 1, 1, 1, 1, 1, 1] - ], - [[1], [1]], - [[], []] - ]); - - for (const [tree, expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${tree}]`, () => { - expect(postorderTraversal(createBinaryTreeNode(tree))).toEqual(expected); - }); - } -}); diff --git a/solutions/binaryTreePreorderTraversal.test.ts b/solutions/binaryTreePreorderTraversal.test.ts deleted file mode 100644 index b886a64..0000000 --- a/solutions/binaryTreePreorderTraversal.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import preorderTraversal from "./binaryTreePreorderTraversal"; - -describe("144. Binary Tree Preorder Traversal", () => { - const TEST_CASES = new Map([ - [[1, null, 2, 3], [1, 2, 3]], - [[4, 4, 5, 1, 2], [4, 4, 1, 2, 5]], - [ - [1, null, 1, null, 1, null, 1, null, 1, null, 1, 2], - [1, 1, 1, 1, 1, 1, 2] - ], - [[1], [1]], - [[], []] - ]); - - for (const [tree, expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${tree}]`, () => { - expect(preorderTraversal(createBinaryTreeNode(tree))).toEqual(expected); - }); - } -}); diff --git a/solutions/binarySearch.ts b/solutions/binary_search.ts similarity index 100% rename from solutions/binarySearch.ts rename to solutions/binary_search.ts diff --git a/solutions/binary_search_test.ts b/solutions/binary_search_test.ts new file mode 100644 index 0000000..315a888 --- /dev/null +++ b/solutions/binary_search_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import search from "./binary_search.ts"; + +test("704. Binary Search", () => { + assert(search([-1, 0, 3, 5, 9, 12], 9) === 4); + assert(search([-1, 0, 3, 5, 9, 12], 13) === -1); +}); diff --git a/solutions/binaryTreeInorderTraversal.ts b/solutions/binary_tree_inorder_traversal.ts similarity index 88% rename from solutions/binaryTreeInorderTraversal.ts rename to solutions/binary_tree_inorder_traversal.ts index 9d39c23..afcb327 100644 --- a/solutions/binaryTreeInorderTraversal.ts +++ b/solutions/binary_tree_inorder_traversal.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 94. Binary Tree Inorder Traversal // https://leetcode.com/problems/binary-tree-inorder-traversal/ diff --git a/solutions/binary_tree_inorder_traversal_test.ts b/solutions/binary_tree_inorder_traversal_test.ts new file mode 100644 index 0000000..3765f59 --- /dev/null +++ b/solutions/binary_tree_inorder_traversal_test.ts @@ -0,0 +1,27 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import inorderTraversal from "./binary_tree_inorder_traversal.ts"; + +test("94. Binary Tree Inorder Traversal", () => { + assertEquals(inorderTraversal(createBinaryTreeNode([1, null, 2, 3])), [ + 1, + 3, + 2 + ]); + assertEquals(inorderTraversal(createBinaryTreeNode([4, 4, 5, 1, 2])), [ + 1, + 4, + 2, + 4, + 5 + ]); + assertEquals( + inorderTraversal( + createBinaryTreeNode([1, null, 1, null, 1, null, 1, null, 1, null, 1, 2]) + ), + [1, 1, 1, 1, 1, 2, 1] + ); + assertEquals(inorderTraversal(createBinaryTreeNode([1])), [1]); + assertEquals(inorderTraversal(createBinaryTreeNode([])), []); +}); diff --git a/solutions/binaryTreeLevelOrderTraversal.ts b/solutions/binary_tree_level_order_traversal.ts similarity index 91% rename from solutions/binaryTreeLevelOrderTraversal.ts rename to solutions/binary_tree_level_order_traversal.ts index d096604..d9c5675 100644 --- a/solutions/binaryTreeLevelOrderTraversal.ts +++ b/solutions/binary_tree_level_order_traversal.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 102. Binary Tree Level Order Traversal // https://leetcode.com/problems/binary-tree-level-order-traversal/ diff --git a/solutions/binary_tree_level_order_traversal_test.ts b/solutions/binary_tree_level_order_traversal_test.ts new file mode 100644 index 0000000..17b51a8 --- /dev/null +++ b/solutions/binary_tree_level_order_traversal_test.ts @@ -0,0 +1,25 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import levelorder from "./binary_tree_level_order_traversal.ts"; + +test("102. Binary Tree Level Order Traversal", () => { + assertEquals(levelorder(createBinaryTreeNode([1, null, 2, 3])), [ + [1], + [2], + [3] + ]); + assertEquals(levelorder(createBinaryTreeNode([4, 4, 5, 1, 2])), [ + [4], + [4, 5], + [1, 2] + ]); + assertEquals( + levelorder( + createBinaryTreeNode([1, null, 1, null, 1, null, 1, null, 1, null, 1, 2]) + ), + [[1], [1], [1], [1], [1], [1], [2]] + ); + assertEquals(levelorder(createBinaryTreeNode([1])), [[1]]); + assertEquals(levelorder(createBinaryTreeNode([])), []); +}); diff --git a/solutions/binaryTreePostorderTraversal.ts b/solutions/binary_tree_postorder_traversal.ts similarity index 88% rename from solutions/binaryTreePostorderTraversal.ts rename to solutions/binary_tree_postorder_traversal.ts index 8cf3475..73aa265 100644 --- a/solutions/binaryTreePostorderTraversal.ts +++ b/solutions/binary_tree_postorder_traversal.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 145. Binary Tree Postorder Traversal // https://leetcode.com/problems/binary-tree-postorder-traversal/ diff --git a/solutions/binary_tree_postorder_traversal_test.ts b/solutions/binary_tree_postorder_traversal_test.ts new file mode 100644 index 0000000..69aa0b2 --- /dev/null +++ b/solutions/binary_tree_postorder_traversal_test.ts @@ -0,0 +1,27 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import postorderTraversal from "./binary_tree_postorder_traversal.ts"; + +test("145. Binary Tree Postorder Traversal", () => { + assertEquals(postorderTraversal(createBinaryTreeNode([1, null, 2, 3])), [ + 3, + 2, + 1 + ]); + assertEquals(postorderTraversal(createBinaryTreeNode([4, 4, 5, 1, 2])), [ + 1, + 2, + 4, + 5, + 4 + ]); + assertEquals( + postorderTraversal( + createBinaryTreeNode([1, null, 1, null, 1, null, 1, null, 1, null, 1, 2]) + ), + [2, 1, 1, 1, 1, 1, 1] + ); + assertEquals(postorderTraversal(createBinaryTreeNode([1])), [1]); + assertEquals(postorderTraversal(createBinaryTreeNode([])), []); +}); diff --git a/solutions/binaryTreePreorderTraversal.ts b/solutions/binary_tree_preorder_traversal.ts similarity index 88% rename from solutions/binaryTreePreorderTraversal.ts rename to solutions/binary_tree_preorder_traversal.ts index 1756d4a..4e976d7 100644 --- a/solutions/binaryTreePreorderTraversal.ts +++ b/solutions/binary_tree_preorder_traversal.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 144. Binary Tree Preorder Traversal // https://leetcode.com/problems/binary-tree-preorder-traversal/ diff --git a/solutions/binary_tree_preorder_traversal_test.ts b/solutions/binary_tree_preorder_traversal_test.ts new file mode 100644 index 0000000..f83b1c1 --- /dev/null +++ b/solutions/binary_tree_preorder_traversal_test.ts @@ -0,0 +1,27 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import preorderTraversal from "./binary_tree_preorder_traversal.ts"; + +test("144. Binary Tree Preorder Traversal", () => { + assertEquals(preorderTraversal(createBinaryTreeNode([1, null, 2, 3])), [ + 1, + 2, + 3 + ]); + assertEquals(preorderTraversal(createBinaryTreeNode([4, 4, 5, 1, 2])), [ + 4, + 4, + 1, + 2, + 5 + ]); + assertEquals( + preorderTraversal( + createBinaryTreeNode([1, null, 1, null, 1, null, 1, null, 1, null, 1, 2]) + ), + [1, 1, 1, 1, 1, 1, 2] + ); + assertEquals(preorderTraversal(createBinaryTreeNode([1])), [1]); + assertEquals(preorderTraversal(createBinaryTreeNode([])), []); +}); diff --git a/solutions/bullsAndCows.test.ts b/solutions/bullsAndCows.test.ts deleted file mode 100644 index f1f38a5..0000000 --- a/solutions/bullsAndCows.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import getHint from "./bullsAndCows"; - -describe("299. Bulls and Cows", () => { - const TEST_CASES = new Map([ - [["1807", "7810"], "1A3B"], - [["1123", "0111"], "1A1B"], - [["1234", "5678"], "0A0B"], - [["1234", "1234"], "4A0B"], - [["1234", "4123"], "0A4B"], - [["1122", "0001"], "0A1B"], - [["11", "10"], "1A0B"] - ]); - - for (const [[secret, guess], expected] of TEST_CASES) { - it(`returns ${expected} when called with ${secret} and ${guess}`, () => { - expect(getHint(secret, guess)).toBe(expected); - }); - } -}); diff --git a/solutions/bullsAndCows.ts b/solutions/bulls_and_cows.ts similarity index 90% rename from solutions/bullsAndCows.ts rename to solutions/bulls_and_cows.ts index 2747fe8..bce2eab 100644 --- a/solutions/bullsAndCows.ts +++ b/solutions/bulls_and_cows.ts @@ -1,6 +1,6 @@ // 299. Bulls and Cows // https://leetcode.com/problems/bulls-and-cows/ -function getHint(secret: string, guess: string): string { +export default function getHint(secret: string, guess: string): string { let bullsCount = 0; let cowsCount = 0; // arrays in javascript is hashmap. actually it runs even without parseInt() below @@ -32,5 +32,3 @@ function getHint(secret: string, guess: string): string { return `${bullsCount}A${cowsCount}B`; } - -export default getHint; diff --git a/solutions/bulls_and_cows_test.ts b/solutions/bulls_and_cows_test.ts new file mode 100644 index 0000000..98884ef --- /dev/null +++ b/solutions/bulls_and_cows_test.ts @@ -0,0 +1,13 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import getHint from "./bulls_and_cows.ts"; + +test("299. Bulls and Cows", () => { + assert(getHint("1807", "7810") === "1A3B"); + assert(getHint("1123", "0111") === "1A1B"); + assert(getHint("1234", "5678") === "0A0B"); + assert(getHint("1234", "1234") === "4A0B"); + assert(getHint("1234", "4123") === "0A4B"); + assert(getHint("1122", "0001") === "0A1B"); + assert(getHint("11", "10") === "1A0B"); +}); diff --git a/solutions/climbingStairs.test.ts b/solutions/climbingStairs.test.ts deleted file mode 100644 index 067c815..0000000 --- a/solutions/climbingStairs.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import climbStairs from "./climbingStairs"; - -describe("70. Climbing Stairs", () => { - const TEST_CASES = new Map([[1, 1], [2, 2], [3, 3], [4, 5], [32, 3524578]]); - - for (const [n, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${n}`, () => { - expect(climbStairs(n)).toBe(expected); - }); - } -}); diff --git a/solutions/climbingStairs.ts b/solutions/climbing_stairs.ts similarity index 79% rename from solutions/climbingStairs.ts rename to solutions/climbing_stairs.ts index 0e80996..48ac312 100644 --- a/solutions/climbingStairs.ts +++ b/solutions/climbing_stairs.ts @@ -1,6 +1,6 @@ // 70. Climbing Stairs // https://leetcode.com/problems/climbing-stairs/ -function climbStairs(n: number): number { +export default function climbStairs(n: number): number { if (memo.has(n)) { return memo.get(n)!; } @@ -13,5 +13,3 @@ function climbStairs(n: number): number { } const memo = new Map([[1, 1], [2, 2]]); - -export default climbStairs; diff --git a/solutions/climbing_stairs_test.ts b/solutions/climbing_stairs_test.ts new file mode 100644 index 0000000..8fda49c --- /dev/null +++ b/solutions/climbing_stairs_test.ts @@ -0,0 +1,11 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import climbStairs from "./climbing_stairs.ts"; + +test("70. Climbing Stairs", () => { + assert(climbStairs(1) === 1); + assert(climbStairs(2) === 2); + assert(climbStairs(3) === 3); + assert(climbStairs(4) === 5); + assert(climbStairs(32) === 3524578); +}); diff --git a/solutions/countCompleteTreeNodes.test.ts b/solutions/countCompleteTreeNodes.test.ts deleted file mode 100644 index 7b25686..0000000 --- a/solutions/countCompleteTreeNodes.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import countNodes from "./countCompleteTreeNodes"; - -describe("222. Count Complete Tree Nodes", () => { - const TEST_CASES = new Map([ - [[1, 2, 3, 4, 5, 6], 6], - [[], 0], - [[1, 2, 3, 4, 5, 6, 7, 8], 8], - [[1, 2, 3, 4, 5, 6, 7], 7] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(countNodes(createBinaryTreeNode(values))).toBe(expected); - }); - } -}); diff --git a/solutions/countUnivalueSubtrees.test.ts b/solutions/countUnivalueSubtrees.test.ts deleted file mode 100644 index c0a5371..0000000 --- a/solutions/countUnivalueSubtrees.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import countUnivalSubtrees from "./countUnivalueSubtrees"; - -describe("250. Count Univalue Subtrees", () => { - const TEST_CASES = new Map([ - [[5, 1, 5, 5, 5, null, 5], 4], - [[1, 4, 3, 4, 4, 5, 6], 5], - [[], 0] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(countUnivalSubtrees(createBinaryTreeNode(values))).toBe(expected); - }); - } -}); diff --git a/solutions/countAndSay.ts b/solutions/count_and_say.ts similarity index 90% rename from solutions/countAndSay.ts rename to solutions/count_and_say.ts index f048a6b..af0ee17 100644 --- a/solutions/countAndSay.ts +++ b/solutions/count_and_say.ts @@ -1,6 +1,6 @@ // 38. Count and Say // https://leetcode.com/problems/count-and-say/ -function countAndSay(n: number): string { +export default function countAndSay(n: number): string { function recursion(string: string): string { let lastChar = string[0]; let lastCharStreak = 0; @@ -32,5 +32,3 @@ function countAndSay(n: number): string { return result; } - -export default countAndSay; diff --git a/solutions/countAndSay.test.ts b/solutions/count_and_say_test.ts similarity index 90% rename from solutions/countAndSay.test.ts rename to solutions/count_and_say_test.ts index 37daf29..56b5049 100644 --- a/solutions/countAndSay.test.ts +++ b/solutions/count_and_say_test.ts @@ -1,22 +1,16 @@ -import countAndSay from "./countAndSay"; +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import countAndSay from "./count_and_say.ts"; -describe("38. Count and Say", () => { - const TEST_CASES = new Map([ - [1, "1"], - [2, "11"], - [3, "21"], - [4, "1211"], - [5, "111221"], - [10, "13211311123113112211"], - [ - 30, +test("38. Count and Say", () => { + assert(countAndSay(1) === "1"); + assert(countAndSay(2) === "11"); + assert(countAndSay(3) === "21"); + assert(countAndSay(4) === "1211"); + assert(countAndSay(5) === "111221"); + assert(countAndSay(10) === "13211311123113112211"); + assert( + countAndSay(30) === "3113112221131112311332111213122112311311123112111331121113122112132113121113222112311311221112131221123113112221121113311211131122211211131221131211132221121321132132212321121113121112133221123113112221131112212211131221121321131211132221123113112221131112311332211211133112111311222112111312211311123113322112111312211312111322212321121113121112133221121321132132211331121321132213211231132132211211131221232112111312212221121123222112311311222113111231133211121321321122111312211312111322211213211321322123211211131211121332211231131122211311123113321112131221123113111231121123222112111331121113112221121113122113111231133221121113122113121113221112131221123113111231121123222112111312211312111322212321121113121112131112132112311321322112111312212321121113122122211211232221121321132132211331121321231231121113112221121321132132211322132113213221123113112221133112132123222112111312211312112213211231132132211211131221131211322113321132211221121332211231131122211311123113321112131221123113111231121113311211131221121321131211132221123113112211121312211231131122211211133112111311222112111312211312111322211213211321223112111311222112132113213221133122211311221122111312211312111322212321121113121112131112132112311321322112111312212321121113122122211211232221121321132132211331121321231231121113112221121321132132211322132113213221123113112221133112132123222112111312211312112213211231132132211211131221131211322113321132211221121332211213211321322113311213212312311211131122211213211331121321123123211231131122211211131221131112311332211213211321223112111311222112132113213221123123211231132132211231131122211311123113322112111312211312111322111213122112311311123112112322211213211321322113312211223113112221121113122113111231133221121321132132211331222113321112131122211332113221122112133221123113112221131112311332111213122112311311123112111331121113122112132113121113222112311311221112131221123113112221121113311211131122211211131221131211132221121321132132212321121113121112133221123113112221131112311332111213122112311311123112112322211322311311222113111231133211121312211231131112311211232221121113122113121113222123211211131221132211131221121321131211132221123113112211121312211231131122113221122112133221121321132132211331121321231231121113121113122122311311222113111231133221121113122113121113221112131221123113111231121123222112132113213221133112132123123112111312211322311211133112111312211213211311123113223112111321322123122113222122211211232221121113122113121113222123211211131211121311121321123113213221121113122123211211131221121311121312211213211321322112311311222113311213212322211211131221131211221321123113213221121113122113121113222112131112131221121321131211132221121321132132211331121321232221123113112221131112311322311211131122211213211331121321122112133221121113122113121113222123112221221321132132211231131122211331121321232221121113122113121113222123211211131211121332211213111213122112132113121113222112132113213221232112111312111213322112132113213221133112132123123112111311222112132113311213211221121332211231131122211311123113321112131221123113112221132231131122211211131221131112311332211213211321223112111311222112132113212221132221222112112322211211131221131211132221232112111312111213111213211231131112311311221122132113213221133112132123222112311311222113111231132231121113112221121321133112132112211213322112111312211312111322212321121113121112131112132112311321322112111312212321121113122122211211232221121311121312211213211312111322211213211321322123211211131211121332211213211321322113311213211322132112311321322112111312212321121113122122211211232221121321132132211331121321231231121113112221121321133112132112312321123113112221121113122113111231133221121321132122311211131122211213211321222113222122211211232221123113112221131112311332111213122112311311123112111331121113122112132113121113222112311311221112131221123113112221121113311211131122211211131221131211132221121321132132212321121113121112133221123113112221131112311332111213213211221113122113121113222112132113213221232112111312111213322112132113213221133112132123123112111312211322311211133112111312212221121123222112132113213221133112132123222113223113112221131112311332111213122112311311123112112322211211131221131211132221232112111312111213111213211231132132211211131221131211221321123113213221123113112221131112211322212322211231131122211322111312211312111322211213211321322113311213211331121113122122211211132213211231131122212322211331222113112211" - ] - ]); - - for (const [n, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${n}`, () => { - expect(countAndSay(n)).toBe(expected); - }); - } + ); }); diff --git a/solutions/countCompleteTreeNodes.ts b/solutions/count_complete_tree_nodes.ts similarity index 84% rename from solutions/countCompleteTreeNodes.ts rename to solutions/count_complete_tree_nodes.ts index 2d61635..006ed9f 100644 --- a/solutions/countCompleteTreeNodes.ts +++ b/solutions/count_complete_tree_nodes.ts @@ -1,8 +1,10 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 222. Count Complete Tree Nodes // https://leetcode.com/problems/count-complete-tree-nodes/ -function countNodes(root: BinaryTreeNode | null): number { +export default function countNodes( + root: BinaryTreeNode | null +): number { if (!root) return 0; const leftHeight = calculateHeight(root.left); @@ -20,5 +22,3 @@ function countNodes(root: BinaryTreeNode | null): number { function calculateHeight(root: BinaryTreeNode | null): number { return root ? 1 + calculateHeight(root.left) : 0; } - -export default countNodes; diff --git a/solutions/count_complete_tree_nodes_test.ts b/solutions/count_complete_tree_nodes_test.ts new file mode 100644 index 0000000..f458c74 --- /dev/null +++ b/solutions/count_complete_tree_nodes_test.ts @@ -0,0 +1,11 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import countNodes from "./count_complete_tree_nodes.ts"; + +test("222. Count Complete Tree Nodes", () => { + assert(countNodes(createBinaryTreeNode([1, 2, 3, 4, 5, 6])) === 6); + assert(countNodes(createBinaryTreeNode([])) === 0); + assert(countNodes(createBinaryTreeNode([1, 2, 3, 4, 5, 6, 7, 8])) === 8); + assert(countNodes(createBinaryTreeNode([1, 2, 3, 4, 5, 6, 7])) === 7); +}); diff --git a/solutions/countUnivalueSubtrees.ts b/solutions/count_univalue_subtrees.ts similarity index 92% rename from solutions/countUnivalueSubtrees.ts rename to solutions/count_univalue_subtrees.ts index ad74e79..23e0361 100644 --- a/solutions/countUnivalueSubtrees.ts +++ b/solutions/count_univalue_subtrees.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 250. Count Univalue Subtrees // https://leetcode.com/problems/count-univalue-subtrees/ diff --git a/solutions/count_univalue_subtrees_test.ts b/solutions/count_univalue_subtrees_test.ts new file mode 100644 index 0000000..b79570d --- /dev/null +++ b/solutions/count_univalue_subtrees_test.ts @@ -0,0 +1,14 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import countUnivalSubtrees from "./count_univalue_subtrees.ts"; + +test("250. Count Univalue Subtrees", () => { + assert( + countUnivalSubtrees(createBinaryTreeNode([5, 1, 5, 5, 5, null, 5])) === 4 + ); + assert( + countUnivalSubtrees(createBinaryTreeNode([1, 4, 3, 4, 4, 5, 6])) === 5 + ); + assert(countUnivalSubtrees(createBinaryTreeNode([])) === 0); +}); diff --git a/solutions/diameterOfBinaryTree.test.ts b/solutions/diameterOfBinaryTree.test.ts deleted file mode 100644 index 93b12c7..0000000 --- a/solutions/diameterOfBinaryTree.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import diameterOfBinaryTree from "./diameterOfBinaryTree"; - -describe("543. Diameter of Binary Tree", () => { - const TEST_CASES = new Map([ - [[1, 2, 3, 4, 5], 3], - [[1], 0], - [[], 0], - [ - [ - 4, - -7, - -3, - null, - null, - -9, - -3, - 9, - -7, - -4, - null, - 6, - null, - -6, - -6, - null, - null, - 0, - 6, - 5, - null, - 9, - null, - null, - -1, - -4, - null, - null, - null, - -2 - ], - 8 - ] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(diameterOfBinaryTree(createBinaryTreeNode(values))).toBe(expected); - }); - } -}); diff --git a/solutions/diameterOfBinaryTree.ts b/solutions/diameter_of_binary_tree.ts similarity index 92% rename from solutions/diameterOfBinaryTree.ts rename to solutions/diameter_of_binary_tree.ts index 834805a..f1b40df 100644 --- a/solutions/diameterOfBinaryTree.ts +++ b/solutions/diameter_of_binary_tree.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 543. Diameter of Binary Tree // https://leetcode.com/problems/diameter-of-binary-tree/ diff --git a/solutions/diameter_of_binary_tree_test.ts b/solutions/diameter_of_binary_tree_test.ts new file mode 100644 index 0000000..e5dde8d --- /dev/null +++ b/solutions/diameter_of_binary_tree_test.ts @@ -0,0 +1,46 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import diameterOfBinaryTree from "./diameter_of_binary_tree.ts"; + +test("543. Diameter of Binary Tree", () => { + assert(diameterOfBinaryTree(createBinaryTreeNode([1, 2, 3, 4, 5])) === 3); + assert(diameterOfBinaryTree(createBinaryTreeNode([1])) === 0); + assert(diameterOfBinaryTree(createBinaryTreeNode([])) === 0); + assert( + diameterOfBinaryTree( + createBinaryTreeNode([ + 4, + -7, + -3, + null, + null, + -9, + -3, + 9, + -7, + -4, + null, + 6, + null, + -6, + -6, + null, + null, + 0, + 6, + 5, + null, + 9, + null, + null, + -1, + -4, + null, + null, + null, + -2 + ]) + ) === 8 + ); +}); diff --git a/solutions/distance_between_bus_stops.ts b/solutions/distance_between_bus_stops.ts new file mode 100644 index 0000000..657ea01 --- /dev/null +++ b/solutions/distance_between_bus_stops.ts @@ -0,0 +1,23 @@ +// 1184. Distance Between Bus Stops +// https://leetcode.com/problems/distance-between-bus-stops/ +export default function distanceBetweenBusStops( + distance: number[], + start: number, + destination: number +): number { + const lessIndex = Math.min(start, destination); + const moreIndex = lessIndex === start ? destination : start; + + let clockwise = 0; + let counterclockwise = 0; + + for (let i = 0; i < distance.length; ++i) { + if (i < lessIndex || i >= moreIndex) { + counterclockwise += distance[i]; + } else { + clockwise += distance[i]; + } + } + + return Math.min(clockwise, counterclockwise); +} diff --git a/solutions/distance_between_bus_stops_test.ts b/solutions/distance_between_bus_stops_test.ts new file mode 100644 index 0000000..26135c2 --- /dev/null +++ b/solutions/distance_between_bus_stops_test.ts @@ -0,0 +1,9 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import distanceBetweenBusStops from "./distance_between_bus_stops.ts"; + +test("1184. Distance Between Bus Stops", () => { + assert(distanceBetweenBusStops([1, 2, 3, 4], 0, 1) === 1); + assert(distanceBetweenBusStops([1, 2, 3, 4], 0, 2) === 3); + assert(distanceBetweenBusStops([1, 2, 3, 4], 0, 3) === 4); +}); diff --git a/solutions/findFirstAndLastPositionOfElementInSortedArray.test.ts b/solutions/findFirstAndLastPositionOfElementInSortedArray.test.ts deleted file mode 100644 index e308638..0000000 --- a/solutions/findFirstAndLastPositionOfElementInSortedArray.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import searchRange from "./findFirstAndLastPositionOfElementInSortedArray"; - -describe("34. Find First and Last Position of Element in Sorted Array", () => { - const TEST_CASES = new Map<[number[], number], [number, number]>([ - [[[5, 7, 7, 8, 8, 10], 8], [3, 4]], - [[[5, 7, 7, 8, 8, 10], 6], [-1, -1]], - [[[2, 2], 2], [0, 1]] - ]); - - for (const [[nums, target], expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${nums}] and ${target}`, () => { - expect(searchRange(nums, target)).toEqual(expected); - }); - } -}); diff --git a/solutions/findKClosestElements.test.ts b/solutions/findKClosestElements.test.ts deleted file mode 100644 index 0a11f29..0000000 --- a/solutions/findKClosestElements.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import findClosestElements from "./findKClosestElements"; - -describe("658. Find K Closest Elements", () => { - const TEST_CASES = new Map<[number[], number, number], number[]>([ - [[[1, 2, 3, 4, 5], 4, 3], [1, 2, 3, 4]], - [[[1, 2, 3, 4, 5], 4, -1], [1, 2, 3, 4]], - [[[1, 2], 1, 1], [1]], - [[[1, 3, 3, 4, 5, 7, 7, 8, 8, 8], 6, 6], [4, 5, 7, 7, 8, 8]] - ]); - - for (const [[arr, k, x], expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${arr}], ${k} and ${x}`, () => { - expect(findClosestElements(arr, k, x)).toEqual(expected); - }); - } -}); diff --git a/solutions/findMinimumInRotatedSortedArray.test.ts b/solutions/findMinimumInRotatedSortedArray.test.ts deleted file mode 100644 index 2f8481a..0000000 --- a/solutions/findMinimumInRotatedSortedArray.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import findMin from "./findMinimumInRotatedSortedArray"; - -describe("153. Find Minimum in Rotated Sorted Array", () => { - const TEST_CASES = new Map([ - [[3, 4, 5, 1, 2], 1], - [[4, 5, 6, 7, 0, 1, 2], 0], - [[3, 1, 2], 1], - [[1, 2, 3, 4, 5, 6], 1], - [[2, 1], 1], - [[1], 1] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(findMin(values)).toBe(expected); - }); - } -}); diff --git a/solutions/findPeakElement.test.ts b/solutions/findPeakElement.test.ts deleted file mode 100644 index 11f3647..0000000 --- a/solutions/findPeakElement.test.ts +++ /dev/null @@ -1,29 +0,0 @@ -import findPeakElement from "./findPeakElement"; - -describe("162. Find Peak Element", () => { - const TEST_CASES = new Map([ - [[1, 2, 3, 1], [2]], - [[1, 2, 1, 3, 5, 6, 4], [1, 5]], - [[2, 1], [0]], - [[1], [0]] - ]); - - for (const [values, expectedOneOf] of TEST_CASES) { - it(`returns ${ - expectedOneOf.length === 1 - ? expectedOneOf[0] - : "either " + - expectedOneOf.reduce( - (s, v, i) => - i === expectedOneOf.length - 1 - ? `${s} or ${v}` - : i > 0 - ? `${s}, ${v}` - : `${v}`, - "" - ) - } when called with [${values}]`, () => { - expect(expectedOneOf.includes(findPeakElement(values))).toBeTruthy(); - }); - } -}); diff --git a/solutions/findTheTownJudge.test.ts b/solutions/findTheTownJudge.test.ts deleted file mode 100644 index 0e1b816..0000000 --- a/solutions/findTheTownJudge.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import findJudge from "./findTheTownJudge"; - -describe("997. Find the Town Judge", () => { - const TEST_CASES = new Map<[number, [number, number][]], number>([ - [[2, [[1, 2]]], 2], - [[3, [[1, 3], [2, 3]]], 3], - [[3, [[1, 3], [2, 3], [3, 1]]], -1], - [[3, [[1, 2], [2, 3]]], -1], - [[4, [[1, 3], [1, 4], [2, 3], [2, 4], [4, 3]]], 3], - [[1, []], 1] - ]); - - for (const [[n, trust], expected] of TEST_CASES) { - it(`returns ${expected} when called with ${n} and [${trust}]`, () => { - expect(findJudge(n, trust)).toBe(expected); - }); - } -}); diff --git a/solutions/findAllAnagramsInAString.ts b/solutions/find_all_anagrams_in_a_string.ts similarity index 100% rename from solutions/findAllAnagramsInAString.ts rename to solutions/find_all_anagrams_in_a_string.ts diff --git a/solutions/findAllAnagramsInAString.test.ts b/solutions/find_all_anagrams_in_a_string_test.ts similarity index 97% rename from solutions/findAllAnagramsInAString.test.ts rename to solutions/find_all_anagrams_in_a_string_test.ts index 4d634f9..f670a80 100644 --- a/solutions/findAllAnagramsInAString.test.ts +++ b/solutions/find_all_anagrams_in_a_string_test.ts @@ -1,21 +1,15 @@ -import findAnagrams from "./findAllAnagramsInAString"; +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import findAnagrams from "./find_all_anagrams_in_a_string.ts"; -describe("438. Find All Anagrams in a String", () => { - const TEST_CASES = new Map([ - [["cbaebabacd", "abc"], [0, 6]], - [["abab", "ab"], [0, 1, 2]], - [ - [ - "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", - "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" - ], - Array.from(new Array(10063), (_, i) => i) - ] - ]); - - for (const [[s, p], expected] of TEST_CASES) { - it(`returns [${expected}] when called with ${s} and ${p}`, () => { - expect(findAnagrams(s, p)).toEqual(expected); - }); - } +test("438. Find All Anagrams in a String", () => { + assertEquals(findAnagrams("cbaebabacd", "abc"), [0, 6]); + assertEquals(findAnagrams("abab", "ab"), [0, 1, 2]); + assertEquals( + findAnagrams( + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" + ), + Array.from(new Array(10063), (_, i) => i) + ); }); diff --git a/solutions/findFirstAndLastPositionOfElementInSortedArray.ts b/solutions/find_first_and_last_position_of_element_in_sorted_array.ts similarity index 100% rename from solutions/findFirstAndLastPositionOfElementInSortedArray.ts rename to solutions/find_first_and_last_position_of_element_in_sorted_array.ts diff --git a/solutions/find_first_and_last_position_of_element_in_sorted_array_test.ts b/solutions/find_first_and_last_position_of_element_in_sorted_array_test.ts new file mode 100644 index 0000000..c2d67ad --- /dev/null +++ b/solutions/find_first_and_last_position_of_element_in_sorted_array_test.ts @@ -0,0 +1,9 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import searchRange from "./find_first_and_last_position_of_element_in_sorted_array.ts"; + +test("34. Find First and Last Position of Element in Sorted Array", () => { + assertEquals(searchRange([5, 7, 7, 8, 8, 10], 8), [3, 4]); + assertEquals(searchRange([5, 7, 7, 8, 8, 10], 6), [-1, -1]); + assertEquals(searchRange([2, 2], 2), [0, 1]); +}); diff --git a/solutions/findKClosestElements.ts b/solutions/find_k_closest_elements.ts similarity index 100% rename from solutions/findKClosestElements.ts rename to solutions/find_k_closest_elements.ts diff --git a/solutions/find_k_closest_elements_test.ts b/solutions/find_k_closest_elements_test.ts new file mode 100644 index 0000000..4b545b3 --- /dev/null +++ b/solutions/find_k_closest_elements_test.ts @@ -0,0 +1,17 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import findClosestElements from "./find_k_closest_elements.ts"; + +test("658. Find K Closest Elements", () => { + assertEquals(findClosestElements([1, 2, 3, 4, 5], 4, 3), [1, 2, 3, 4]); + assertEquals(findClosestElements([1, 2, 3, 4, 5], 4, -1), [1, 2, 3, 4]); + assertEquals(findClosestElements([1, 2], 1, 1), [1]); + assertEquals(findClosestElements([1, 3, 3, 4, 5, 7, 7, 8, 8, 8], 6, 6), [ + 4, + 5, + 7, + 7, + 8, + 8 + ]); +}); diff --git a/solutions/findMinimumInRotatedSortedArray.ts b/solutions/find_minimum_in_rotated_sorted_array.ts similarity index 100% rename from solutions/findMinimumInRotatedSortedArray.ts rename to solutions/find_minimum_in_rotated_sorted_array.ts diff --git a/solutions/find_minimum_in_rotated_sorted_array_test.ts b/solutions/find_minimum_in_rotated_sorted_array_test.ts new file mode 100644 index 0000000..125e9ed --- /dev/null +++ b/solutions/find_minimum_in_rotated_sorted_array_test.ts @@ -0,0 +1,12 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import findMin from "./find_minimum_in_rotated_sorted_array.ts"; + +test("153. Find Minimum in Rotated Sorted Array", () => { + assert(findMin([3, 4, 5, 1, 2]) === 1); + assert(findMin([4, 5, 6, 7, 0, 1, 2]) === 0); + assert(findMin([3, 1, 2]) === 1); + assert(findMin([1, 2, 3, 4, 5, 6]) === 1); + assert(findMin([2, 1]) === 1); + assert(findMin([1]) === 1); +}); diff --git a/solutions/findPeakElement.ts b/solutions/find_peak_element.ts similarity index 100% rename from solutions/findPeakElement.ts rename to solutions/find_peak_element.ts diff --git a/solutions/find_peak_element_test.ts b/solutions/find_peak_element_test.ts new file mode 100644 index 0000000..4243e98 --- /dev/null +++ b/solutions/find_peak_element_test.ts @@ -0,0 +1,10 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import findPeakElement from "./find_peak_element.ts"; + +test("162. Find Peak Element", () => { + assert(findPeakElement([1, 2, 3, 1]) === 2); + assert([1, 5].includes(findPeakElement([1, 2, 1, 3, 5, 6, 4]))); + assert(findPeakElement([2, 1]) === 0); + assert(findPeakElement([1]) === 0); +}); diff --git a/solutions/findTheTownJudge.ts b/solutions/find_the_town_judge.ts similarity index 100% rename from solutions/findTheTownJudge.ts rename to solutions/find_the_town_judge.ts diff --git a/solutions/find_the_town_judge_test.ts b/solutions/find_the_town_judge_test.ts new file mode 100644 index 0000000..fb83696 --- /dev/null +++ b/solutions/find_the_town_judge_test.ts @@ -0,0 +1,12 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import findJudge from "./find_the_town_judge.ts"; + +test("997. Find the Town Judge", () => { + assert(findJudge(2, [[1, 2]]) === 2); + assert(findJudge(3, [[1, 3], [2, 3]]) === 3); + assert(findJudge(3, [[1, 3], [2, 3], [3, 1]]) === -1); + assert(findJudge(3, [[1, 2], [2, 3]]) === -1); + assert(findJudge(4, [[1, 3], [1, 4], [2, 3], [2, 4], [4, 3]]) === 3); + assert(findJudge(1, []) === 1); +}); diff --git a/solutions/firstBadVersion.test.ts b/solutions/firstBadVersion.test.ts deleted file mode 100644 index a05afee..0000000 --- a/solutions/firstBadVersion.test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import solution from "./firstBadVersion"; - -describe("278. First Bad Version", () => { - it("returns a function to detect the first bad version", () => { - const findFirstBadVersion = solution(version => version >= 4); - - expect(findFirstBadVersion(5)).toBe(4); - expect(findFirstBadVersion(10)).toBe(4); - }); -}); diff --git a/solutions/firstUniqueCharacterInAString.test.ts b/solutions/firstUniqueCharacterInAString.test.ts deleted file mode 100644 index 44c7add..0000000 --- a/solutions/firstUniqueCharacterInAString.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import firstUniqChar from "./firstUniqueCharacterInAString"; - -describe("387. First Unique Character in a String", () => { - const TEST_CASES = new Map([ - ["leetcode", 0], - ["loveleetcode", 2], - ["leetcodeleetcode", -1], - ["theleetcode", 1], - ["j", 0], - ["", -1] - ]); - - for (const [s, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${s}`, () => { - expect(firstUniqChar(s)).toBe(expected); - }); - } -}); diff --git a/solutions/firstBadVersion.ts b/solutions/first_bad_version.ts similarity index 100% rename from solutions/firstBadVersion.ts rename to solutions/first_bad_version.ts diff --git a/solutions/first_bad_version_test.ts b/solutions/first_bad_version_test.ts new file mode 100644 index 0000000..17b2009 --- /dev/null +++ b/solutions/first_bad_version_test.ts @@ -0,0 +1,10 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import solution from "./first_bad_version.ts"; + +test("278. First Bad Version", () => { + const findFirstBadVersion = solution(version => version >= 4); + + assert(findFirstBadVersion(5) === 4); + assert(findFirstBadVersion(10) === 4); +}); diff --git a/solutions/firstUniqueCharacterInAString.ts b/solutions/first_unique_character_in_a_string.ts similarity index 80% rename from solutions/firstUniqueCharacterInAString.ts rename to solutions/first_unique_character_in_a_string.ts index e4db205..e127fc1 100644 --- a/solutions/firstUniqueCharacterInAString.ts +++ b/solutions/first_unique_character_in_a_string.ts @@ -1,6 +1,6 @@ // 387. First Unique Character in a String // https://leetcode.com/problems/first-unique-character-in-a-string/ -function firstUniqChar(s: string): number { +export default function firstUniqChar(s: string): number { for (let i = 0; i < s.length; ++i) { // if the first and last index of character are the same, it's unique if (s.indexOf(s[i]) === s.lastIndexOf(s[i])) return i; @@ -8,5 +8,3 @@ function firstUniqChar(s: string): number { return -1; } - -export default firstUniqChar; diff --git a/solutions/first_unique_character_in_a_string_test.ts b/solutions/first_unique_character_in_a_string_test.ts new file mode 100644 index 0000000..53c2095 --- /dev/null +++ b/solutions/first_unique_character_in_a_string_test.ts @@ -0,0 +1,12 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import firstUniqChar from "./first_unique_character_in_a_string.ts"; + +test("387. First Unique Character in a String", () => { + assert(firstUniqChar("leetcode") === 0); + assert(firstUniqChar("loveleetcode") === 2); + assert(firstUniqChar("leetcodeleetcode") === -1); + assert(firstUniqChar("theleetcode") === 1); + assert(firstUniqChar("j") === 0); + assert(firstUniqChar("") === -1); +}); diff --git a/solutions/fizzBuzz.test.ts b/solutions/fizzBuzz.test.ts deleted file mode 100644 index 6b80672..0000000 --- a/solutions/fizzBuzz.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import fizzBuzz from "./fizzBuzz"; - -describe("412. Fizz Buzz", () => { - const TEST_CASES = new Map([ - [1, ["1"]], - [3, ["1", "2", "Fizz"]], - [5, ["1", "2", "Fizz", "4", "Buzz"]], - [ - 20, - [ - "1", - "2", - "Fizz", - "4", - "Buzz", - "Fizz", - "7", - "8", - "Fizz", - "Buzz", - "11", - "Fizz", - "13", - "14", - "FizzBuzz", - "16", - "17", - "Fizz", - "19", - "Buzz" - ] - ] - ]); - - for (const [n, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${n}`, () => { - expect(fizzBuzz(n)).toEqual(expected); - }); - } -}); diff --git a/solutions/fizzBuzz.ts b/solutions/fizz_buzz.ts similarity index 84% rename from solutions/fizzBuzz.ts rename to solutions/fizz_buzz.ts index 7925e5b..c2d4906 100644 --- a/solutions/fizzBuzz.ts +++ b/solutions/fizz_buzz.ts @@ -1,6 +1,6 @@ // 412. Fizz Buzz // https://leetcode.com/problems/fizz-buzz/ -function fizzBuzz(n: number): string[] { +export default function fizzBuzz(n: number): string[] { const arr: string[] = []; for (let i = 1; i <= n; ++i) { @@ -17,5 +17,3 @@ function fizzBuzz(n: number): string[] { return arr; } - -export default fizzBuzz; diff --git a/solutions/fizz_buzz_test.ts b/solutions/fizz_buzz_test.ts new file mode 100644 index 0000000..8947f5a --- /dev/null +++ b/solutions/fizz_buzz_test.ts @@ -0,0 +1,31 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import fizzBuzz from "./fizz_buzz.ts"; + +test("412. Fizz Buzz", () => { + assertEquals(fizzBuzz(1), ["1"]); + assertEquals(fizzBuzz(3), ["1", "2", "Fizz"]); + assertEquals(fizzBuzz(5), ["1", "2", "Fizz", "4", "Buzz"]); + assertEquals(fizzBuzz(20), [ + "1", + "2", + "Fizz", + "4", + "Buzz", + "Fizz", + "7", + "8", + "Fizz", + "Buzz", + "11", + "Fizz", + "13", + "14", + "FizzBuzz", + "16", + "17", + "Fizz", + "19", + "Buzz" + ]); +}); diff --git a/solutions/flipping_an_image.ts b/solutions/flipping_an_image.ts new file mode 100644 index 0000000..ee27bce --- /dev/null +++ b/solutions/flipping_an_image.ts @@ -0,0 +1,11 @@ +// 832. Flipping an Image +// https://leetcode.com/problems/flipping-an-image/ +export default function flipAndInvertImage(a: (1 | 0)[][]): (1 | 0)[][] { + for (const row of a) { + for (let l = 0, r = row.length - 1; l <= r; ++l, --r) { + [row[l], row[r]] = [-row[r] + 1, -row[l] + 1] as (1 | 0)[]; + } + } + + return a; +} diff --git a/solutions/flipping_an_image_test.ts b/solutions/flipping_an_image_test.ts new file mode 100644 index 0000000..cdd7537 --- /dev/null +++ b/solutions/flipping_an_image_test.ts @@ -0,0 +1,20 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import flipAndInvertImage from "./flipping_an_image.ts"; + +test("832. Flipping an Image", () => { + assertEquals(flipAndInvertImage([[1, 1, 0], [1, 0, 1], [0, 0, 0]]), [ + [1, 0, 0], + [0, 1, 0], + [1, 1, 1] + ]); + assertEquals( + flipAndInvertImage([ + [1, 1, 0, 0], + [1, 0, 0, 1], + [0, 1, 1, 1], + [1, 0, 1, 0] + ]), + [[1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 0, 1], [1, 0, 1, 0]] + ); +}); diff --git a/solutions/floodFill.test.ts b/solutions/floodFill.test.ts deleted file mode 100644 index 147a6d1..0000000 --- a/solutions/floodFill.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import floodFill from "./floodFill"; - -describe("733. Flood Fill", () => { - const TEST_CASES = new Map<[number[][], number, number, number], number[][]>([ - [ - [[[1, 1, 1], [1, 1, 0], [1, 0, 1]], 1, 1, 2], - [[2, 2, 2], [2, 2, 0], [2, 0, 1]] - ], - [ - [ - [ - [0, 0, 0, 0, 0], - [0, 1, 1, 1, 1], - [0, 1, 0, 0, 0], - [0, 1, 0, 0, 0], - [0, 1, 0, 0, 0] - ], - 3, - 3, - 255 - ], - [ - [0, 0, 0, 0, 0], - [0, 1, 1, 1, 1], - [0, 1, 255, 255, 255], - [0, 1, 255, 255, 255], - [0, 1, 255, 255, 255] - ] - ], - [[[[0, 0, 0], [0, 1, 1]], 1, 1, 1], [[0, 0, 0], [0, 1, 1]]] - ]); - - for (const [ - [image, startingRow, startingColumn, newColor], - expected - ] of TEST_CASES) { - it(`returns [${expected.map( - row => `[${row}]` - )}] when called with [${image.map( - row => `[${row}]` - )}], ${startingRow}, ${startingColumn} and ${newColor}`, () => { - expect(floodFill(image, startingRow, startingColumn, newColor)).toEqual( - expected - ); - }); - } -}); diff --git a/solutions/floodFill.ts b/solutions/flood_fill.ts similarity index 95% rename from solutions/floodFill.ts rename to solutions/flood_fill.ts index e13b594..d98daed 100644 --- a/solutions/floodFill.ts +++ b/solutions/flood_fill.ts @@ -1,6 +1,6 @@ // 733. Flood Fill // https://leetcode.com/problems/flood-fill/ -function floodFill( +export default function floodFill( image: number[][], startingRow: number, startingColumn: number, @@ -45,5 +45,3 @@ function floodFill( // [row, column] type PixelPosition = [number, number]; - -export default floodFill; diff --git a/solutions/flood_fill_test.ts b/solutions/flood_fill_test.ts new file mode 100644 index 0000000..01d16ff --- /dev/null +++ b/solutions/flood_fill_test.ts @@ -0,0 +1,36 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import floodFill from "./flood_fill.ts"; + +test("733. Flood Fill", () => { + assertEquals(floodFill([[1, 1, 1], [1, 1, 0], [1, 0, 1]], 1, 1, 2), [ + [2, 2, 2], + [2, 2, 0], + [2, 0, 1] + ]); + assertEquals( + floodFill( + [ + [0, 0, 0, 0, 0], + [0, 1, 1, 1, 1], + [0, 1, 0, 0, 0], + [0, 1, 0, 0, 0], + [0, 1, 0, 0, 0] + ], + 3, + 3, + 255 + ), + [ + [0, 0, 0, 0, 0], + [0, 1, 1, 1, 1], + [0, 1, 255, 255, 255], + [0, 1, 255, 255, 255], + [0, 1, 255, 255, 255] + ] + ); + assertEquals(floodFill([[0, 0, 0], [0, 1, 1]], 1, 1, 1), [ + [0, 0, 0], + [0, 1, 1] + ]); +}); diff --git a/solutions/happyNumber.test.ts b/solutions/happyNumber.test.ts deleted file mode 100644 index 37f3ac8..0000000 --- a/solutions/happyNumber.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import isHappy from "./happyNumber"; - -describe("202. Happy Number", () => { - const TEST_CASES = new Map([[19, true], [18, false]]); - - for (const [n, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${n}`, () => { - expect(isHappy(n)).toBe(expected); - }); - } -}); diff --git a/solutions/happyNumber.ts b/solutions/happy_number.ts similarity index 83% rename from solutions/happyNumber.ts rename to solutions/happy_number.ts index 8e77c1b..4d49188 100644 --- a/solutions/happyNumber.ts +++ b/solutions/happy_number.ts @@ -1,6 +1,6 @@ // 202. Happy Number // https://leetcode.com/problems/happy-number/ -function isHappy(n: number): boolean { +export default function isHappy(n: number): boolean { if (n === 1) return true; // any non-happy number is going to be 4 at certain point @@ -12,5 +12,3 @@ function isHappy(n: number): boolean { .reduce((total, digit) => total + Math.pow(parseInt(digit), 2), 0) ); } - -export default isHappy; diff --git a/solutions/happy_number_test.ts b/solutions/happy_number_test.ts new file mode 100644 index 0000000..250b909 --- /dev/null +++ b/solutions/happy_number_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import isHappy from "./happy_number.ts"; + +test("202. Happy Number", () => { + assert(isHappy(19) === true); + assert(isHappy(18) === false); +}); diff --git a/solutions/houseRobber.test.ts b/solutions/houseRobber.test.ts deleted file mode 100644 index 0e8ead1..0000000 --- a/solutions/houseRobber.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import rob from "./houseRobber"; - -describe("198. House Robber", () => { - const TEST_CASES = new Map([ - [[1, 2, 3, 1], 4], - [[2, 7, 9, 3, 1], 12], - [[2, 4, 9, 3, 1, 5], 16] - ]); - - for (const [nums, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${nums}]`, () => { - expect(rob(nums)).toBe(expected); - }); - } -}); diff --git a/solutions/houseRobber.ts b/solutions/house_robber.ts similarity index 88% rename from solutions/houseRobber.ts rename to solutions/house_robber.ts index 9178168..2e67dd9 100644 --- a/solutions/houseRobber.ts +++ b/solutions/house_robber.ts @@ -1,6 +1,6 @@ // 198. House Robber // https://leetcode.com/problems/house-robber/ -function rob(nums: number[]): number { +export default function rob(nums: number[]): number { // this is dynamic programming. // see https://github.com/axross/leetcode-typescript/pull/55 const dp = new Map([[-1, 0], [0, 0]]); @@ -13,5 +13,3 @@ function rob(nums: number[]): number { // dp[nums.length] is the maximum amount return dp.get(nums.length)!; } - -export default rob; diff --git a/solutions/house_robber_test.ts b/solutions/house_robber_test.ts new file mode 100644 index 0000000..9fbd0f2 --- /dev/null +++ b/solutions/house_robber_test.ts @@ -0,0 +1,9 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import rob from "./house_robber.ts"; + +test("198. House Robber", () => { + assert(rob([1, 2, 3, 1]) === 4); + assert(rob([2, 7, 9, 3, 1]) === 12); + assert(rob([2, 4, 9, 3, 1, 5]) === 16); +}); diff --git a/solutions/implementStrstr.test.ts b/solutions/implementStrstr.test.ts deleted file mode 100644 index 9968ba1..0000000 --- a/solutions/implementStrstr.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import strStr from "./implementStrstr"; - -describe("28. Implement strStr()", () => { - const TEST_CASES = new Map([ - [["hello", "ll"], 2], - [["aaaaa", "bba"], -1], - [["llooll", "ll"], 0], - [["llooll", "ool"], 2], - [["hello", ""], 0], - [["", "a"], -1], - [["", ""], 0], - [["aaa", "aaaa"], -1], - [["hello", "lo"], 3] - ]); - - for (const [[haystack, needle], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${haystack}] and ${needle}`, () => { - expect(strStr(haystack, needle)).toBe(expected); - }); - } -}); diff --git a/solutions/implementStrstr.ts b/solutions/implement_strstr.ts similarity index 72% rename from solutions/implementStrstr.ts rename to solutions/implement_strstr.ts index 2c9be0e..6c35786 100644 --- a/solutions/implementStrstr.ts +++ b/solutions/implement_strstr.ts @@ -1,6 +1,6 @@ // 28. Implement strStr() // https://leetcode.com/problems/implement-strstr/ -function strStr(haystack: string, needle: string): number { +export default function strStr(haystack: string, needle: string): number { for (let i = 0; i <= haystack.length - needle.length; ++i) { if (haystack.startsWith(needle, i)) { return i; @@ -9,5 +9,3 @@ function strStr(haystack: string, needle: string): number { return -1; } - -export default strStr; diff --git a/solutions/implement_strstr_test.ts b/solutions/implement_strstr_test.ts new file mode 100644 index 0000000..6596208 --- /dev/null +++ b/solutions/implement_strstr_test.ts @@ -0,0 +1,15 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import strStr from "./implement_strstr.ts"; + +test("28. Implement strStr()", () => { + assert(strStr("hello", "ll") === 2); + assert(strStr("aaaaa", "bba") === -1); + assert(strStr("llooll", "ll") === 0); + assert(strStr("llooll", "ool") === 2); + assert(strStr("hello", "") === 0); + assert(strStr("", "a") === -1); + assert(strStr("", "") === 0); + assert(strStr("aaa", "aaaa") === -1); + assert(strStr("hello", "lo") === 3); +}); diff --git a/solutions/intersectionOfTwoArrays.test.ts b/solutions/intersectionOfTwoArrays.test.ts deleted file mode 100644 index 595db7c..0000000 --- a/solutions/intersectionOfTwoArrays.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import intersection from "./intersectionOfTwoArrays"; - -describe("349. Intersection of Two Arrays", () => { - const TEST_CASES = new Map<[number[], number[]], number[]>([ - [[[1, 2, 2, 1], [2, 2]], [2]], - [[[4, 9, 5], [9, 4, 9, 8, 4]], [9, 4]] - ]); - - for (const [[nums1, nums2], expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${nums1}] and [${nums2}]`, () => { - expect(intersection(nums1, nums2)).toEqual(expected); - }); - } -}); diff --git a/solutions/intersectionOfTwoArrays2.test.ts b/solutions/intersectionOfTwoArrays2.test.ts deleted file mode 100644 index c6436c6..0000000 --- a/solutions/intersectionOfTwoArrays2.test.ts +++ /dev/null @@ -1,147 +0,0 @@ -import intersect from "./intersectionOfTwoArrays2"; - -describe("350. Intersection of Two Arrays II", () => { - const TEST_CASES = new Map<[number[], number[]], number[]>([ - [[[1, 2, 2, 1], [2, 2]], [2, 2]], - [[[4, 9, 5], [9, 4, 9, 8, 4]], [4, 9]], - [ - [ - [ - 61, - 24, - 20, - 58, - 95, - 53, - 17, - 32, - 45, - 85, - 70, - 20, - 83, - 62, - 35, - 89, - 5, - 95, - 12, - 86, - 58, - 77, - 30, - 64, - 46, - 13, - 5, - 92, - 67, - 40, - 20, - 38, - 31, - 18, - 89, - 85, - 7, - 30, - 67, - 34, - 62, - 35, - 47, - 98, - 3, - 41, - 53, - 26, - 66, - 40, - 54, - 44, - 57, - 46, - 70, - 60, - 4, - 63, - 82, - 42, - 65, - 59, - 17, - 98, - 29, - 72, - 1, - 96, - 82, - 66, - 98, - 6, - 92, - 31, - 43, - 81, - 88, - 60, - 10, - 55, - 66, - 82, - 0, - 79, - 11, - 81 - ], - [ - 5, - 25, - 4, - 39, - 57, - 49, - 93, - 79, - 7, - 8, - 49, - 89, - 2, - 7, - 73, - 88, - 45, - 15, - 34, - 92, - 84, - 38, - 85, - 34, - 16, - 6, - 99, - 0, - 2, - 36, - 68, - 52, - 73, - 50, - 77, - 44, - 61, - 48 - ] - ], - [0, 4, 5, 6, 7, 34, 38, 44, 45, 57, 61, 77, 79, 85, 88, 89, 92] - ] - ]); - - for (const [[nums1, nums2], expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${nums1}] and [${nums2}]`, () => { - expect(intersect(nums1, nums2).sort((a, b) => a - b)).toEqual(expected); - }); - } -}); diff --git a/solutions/intersectionOfTwoLinkedLists.test.ts b/solutions/intersectionOfTwoLinkedLists.test.ts deleted file mode 100644 index aa5a2e5..0000000 --- a/solutions/intersectionOfTwoLinkedLists.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { - createSinglyLinkedListNode, - getNthNode -} from "../testUtilities/LinkedList"; -import { SinglyLinkedListNode } from "../types/LinkedList"; -import getIntersectionNode from "./intersectionOfTwoLinkedLists"; - -describe("160. Intersection of Two Linked Lists", () => { - const TEST_CASES: [any, number[], number[], number, number][] = [ - [8, [4, 1, 8, 4, 5], [5, 0, 1, 8, 4, 5], 2, 3], - [2, [0, 9, 1, 2, 4], [3, 2, 4], 3, 1], - [0, [2, 6, 4], [1, 5], 3, 2] - ]; - - for (const [, valuesA, valuesB, skipA, skipB] of TEST_CASES) { - const headA = createSinglyLinkedListNode(valuesA); - const headB = createSinglyLinkedListNode(valuesB); - let intersection: SinglyLinkedListNode | null = null; - - if (skipA < valuesA.length) { - intersection = getNthNode(headA!, skipA); - - getNthNode(headB!, skipB - 1).next = intersection; - } - - it(`returns the ${skipA}th node of "linked list A" when called with [${valuesA}], [${valuesB}], ${skipA} and ${skipB}`, () => { - expect(getIntersectionNode(headA, headB)).toBe(intersection); - }); - } -}); diff --git a/solutions/intersectionOfTwoArrays.ts b/solutions/intersection_of_two_arrays.ts similarity index 77% rename from solutions/intersectionOfTwoArrays.ts rename to solutions/intersection_of_two_arrays.ts index add31bd..2ec6ed0 100644 --- a/solutions/intersectionOfTwoArrays.ts +++ b/solutions/intersection_of_two_arrays.ts @@ -1,6 +1,9 @@ // 349. Intersection of Two Arrays // https://leetcode.com/problems/intersection-of-two-arrays/ -function intersection(nums1: number[], nums2: number[]): number[] { +export default function intersection( + nums1: number[], + nums2: number[] +): number[] { const set = new Set(); const result: number[] = []; @@ -17,5 +20,3 @@ function intersection(nums1: number[], nums2: number[]): number[] { return result; } - -export default intersection; diff --git a/solutions/intersectionOfTwoArrays2.ts b/solutions/intersection_of_two_arrays2.ts similarity index 100% rename from solutions/intersectionOfTwoArrays2.ts rename to solutions/intersection_of_two_arrays2.ts diff --git a/solutions/intersection_of_two_arrays2_test.ts b/solutions/intersection_of_two_arrays2_test.ts new file mode 100644 index 0000000..3ed968e --- /dev/null +++ b/solutions/intersection_of_two_arrays2_test.ts @@ -0,0 +1,141 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import intersect from "./intersection_of_two_arrays2.ts"; + +test("350. Intersection of Two Arrays II", () => { + assertEquals(intersect([1, 2, 2, 1], [2, 2]), [2, 2]); + assertEquals(intersect([4, 9, 5], [9, 4, 9, 8, 4]), [4, 9]); + assertEquals( + intersect( + [ + 61, + 24, + 20, + 58, + 95, + 53, + 17, + 32, + 45, + 85, + 70, + 20, + 83, + 62, + 35, + 89, + 5, + 95, + 12, + 86, + 58, + 77, + 30, + 64, + 46, + 13, + 5, + 92, + 67, + 40, + 20, + 38, + 31, + 18, + 89, + 85, + 7, + 30, + 67, + 34, + 62, + 35, + 47, + 98, + 3, + 41, + 53, + 26, + 66, + 40, + 54, + 44, + 57, + 46, + 70, + 60, + 4, + 63, + 82, + 42, + 65, + 59, + 17, + 98, + 29, + 72, + 1, + 96, + 82, + 66, + 98, + 6, + 92, + 31, + 43, + 81, + 88, + 60, + 10, + 55, + 66, + 82, + 0, + 79, + 11, + 81 + ], + [ + 5, + 25, + 4, + 39, + 57, + 49, + 93, + 79, + 7, + 8, + 49, + 89, + 2, + 7, + 73, + 88, + 45, + 15, + 34, + 92, + 84, + 38, + 85, + 34, + 16, + 6, + 99, + 0, + 2, + 36, + 68, + 52, + 73, + 50, + 77, + 44, + 61, + 48 + ] + ), + [0, 4, 5, 6, 7, 34, 38, 44, 45, 57, 61, 77, 79, 85, 88, 89, 92] + ); +}); diff --git a/solutions/intersection_of_two_arrays_test.ts b/solutions/intersection_of_two_arrays_test.ts new file mode 100644 index 0000000..180c38f --- /dev/null +++ b/solutions/intersection_of_two_arrays_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import intersection from "./intersection_of_two_arrays.ts"; + +test("349. Intersection of Two Arrays", () => { + assertEquals(intersection([1, 2, 2, 1], [2, 2]), [2]); + assertEquals(intersection([4, 9, 5], [9, 4, 9, 8, 4]), [9, 4]); +}); diff --git a/solutions/intersectionOfTwoLinkedLists.ts b/solutions/intersection_of_two_linked_lists.ts similarity index 86% rename from solutions/intersectionOfTwoLinkedLists.ts rename to solutions/intersection_of_two_linked_lists.ts index 0fc2b63..f4332b1 100644 --- a/solutions/intersectionOfTwoLinkedLists.ts +++ b/solutions/intersection_of_two_linked_lists.ts @@ -1,4 +1,4 @@ -import { SinglyLinkedListNode } from "../types/LinkedList"; +import { SinglyLinkedListNode } from "../types/linked_list.ts"; // 160. Intersection of Two Linked Lists // https://leetcode.com/problems/intersection-of-two-linked-lists/ diff --git a/solutions/intersection_of_two_linked_lists_test.ts b/solutions/intersection_of_two_linked_lists_test.ts new file mode 100644 index 0000000..eab8a57 --- /dev/null +++ b/solutions/intersection_of_two_linked_lists_test.ts @@ -0,0 +1,30 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { + createSinglyLinkedListNode, + getNthNode +} from "../test_utilities/linked_list.ts"; +import getIntersectionNode from "./intersection_of_two_linked_lists.ts"; + +test("160. Intersection of Two Linked Lists", () => { + const headA1 = createSinglyLinkedListNode([4, 1, 8, 4, 5]); + const headB1 = createSinglyLinkedListNode([5, 0, 1, 8, 4, 5]); + const intersection1 = getNthNode(headA1!, 2); + + getNthNode(headB1!, 2).next = intersection1; + + assert(getIntersectionNode(headA1, headB1) === intersection1); + + const headA2 = createSinglyLinkedListNode([0, 9, 1, 2, 4]); + const headB2 = createSinglyLinkedListNode([3, 2, 4]); + const intersection2 = getNthNode(headA2!, 3); + + getNthNode(headB2!, 0).next = intersection2; + + assert(getIntersectionNode(headA1, headB1) === intersection1); + + const headA3 = createSinglyLinkedListNode([2, 6, 4]); + const headB3 = createSinglyLinkedListNode([1, 5]); + + assert(getIntersectionNode(headA3, headB3) === null); +}); diff --git a/solutions/licenseKeyFormatting.test.ts b/solutions/licenseKeyFormatting.test.ts deleted file mode 100644 index 0c39798..0000000 --- a/solutions/licenseKeyFormatting.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import licenseKeyFormatting from "./licenseKeyFormatting"; - -describe("482. License Key Formatting", () => { - const TEST_CASES = new Map<[string, number], string>([ - [["5F3Z-2e-9-w", 4], "5F3Z-2E9W"], - [["2-5g-3-J", 2], "2-5G-3J"] - ]); - - for (const [[s, k], expected] of TEST_CASES) { - it(`returns ${expected} when called with ${s} and ${k}`, () => { - expect(licenseKeyFormatting(s, k)).toBe(expected); - }); - } -}); diff --git a/solutions/licenseKeyFormatting.ts b/solutions/license_key_formatting.ts similarity index 79% rename from solutions/licenseKeyFormatting.ts rename to solutions/license_key_formatting.ts index d790607..c25a6bb 100644 --- a/solutions/licenseKeyFormatting.ts +++ b/solutions/license_key_formatting.ts @@ -1,6 +1,6 @@ // 482. License Key Formatting // https://leetcode.com/problems/license-key-formatting/ -function licenseKeyFormatting(S: string, K: number): string { +export default function licenseKeyFormatting(S: string, K: number): string { const squashed = S.replace(/-/g, ""); let formatted = ""; @@ -12,5 +12,3 @@ function licenseKeyFormatting(S: string, K: number): string { return formatted.toUpperCase(); } - -export default licenseKeyFormatting; diff --git a/solutions/license_key_formatting_test.ts b/solutions/license_key_formatting_test.ts new file mode 100644 index 0000000..eb79026 --- /dev/null +++ b/solutions/license_key_formatting_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import licenseKeyFormatting from "./license_key_formatting.ts"; + +test("482. License Key Formatting", () => { + assert(licenseKeyFormatting("5F3Z-2e-9-w", 4) === "5F3Z-2E9W"); + assert(licenseKeyFormatting("2-5g-3-J", 2) === "2-5G-3J"); +}); diff --git a/solutions/linkedListCycle.test.ts b/solutions/linkedListCycle.test.ts deleted file mode 100644 index d1ed491..0000000 --- a/solutions/linkedListCycle.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { - createSinglyLinkedListNode, - getNthNode -} from "../testUtilities/LinkedList"; -import hasCycle from "./linkedListCycle"; - -describe("141. Linked List Cycle", () => { - const TEST_CASES = new Map<[number[], number], boolean>([ - [[[3, 2, 0, -4], 1], true], - [[[3, 2, 0, -4], -1], false], - [[[3, 2, 0, -4], 3], true] - ]); - - for (const [[values, cycleStart], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}] ${ - cycleStart === -1 ? "(no cycle)" : `(cycle starts from ${cycleStart})` - }`, () => { - const head = createSinglyLinkedListNode(values)!; - - if (cycleStart !== -1) { - getNthNode(head, -1).next = getNthNode(head, cycleStart); - } - - expect(hasCycle(head)).toBe(expected); - }); - } -}); diff --git a/solutions/linkedListCycle.ts b/solutions/linked_list_cycle.ts similarity index 86% rename from solutions/linkedListCycle.ts rename to solutions/linked_list_cycle.ts index b3e0f3b..648d649 100644 --- a/solutions/linkedListCycle.ts +++ b/solutions/linked_list_cycle.ts @@ -1,4 +1,4 @@ -import { SinglyLinkedListNode } from "../types/LinkedList"; +import { SinglyLinkedListNode } from "../types/linked_list.ts"; // 141. Linked List Cycle // https://leetcode.com/problems/linked-list-cycle/ diff --git a/solutions/linked_list_cycle_test.ts b/solutions/linked_list_cycle_test.ts new file mode 100644 index 0000000..be2cfc9 --- /dev/null +++ b/solutions/linked_list_cycle_test.ts @@ -0,0 +1,25 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { + createSinglyLinkedListNode, + getNthNode +} from "../test_utilities/linked_list.ts"; +import hasCycle from "./linked_list_cycle.ts"; + +test("141. Linked List Cycle", () => { + const node1 = createSinglyLinkedListNode([3, 2, 0, -4])!; + + getNthNode(node1, -1).next = getNthNode(node1, 1); + + assert(hasCycle(node1) === true); + + const node2 = createSinglyLinkedListNode([3, 2, 0, -4])!; + + assert(hasCycle(node2) === false); + + const node3 = createSinglyLinkedListNode([3, 2, 0, -4])!; + + getNthNode(node3, -1).next = getNthNode(node3, 3); + + assert(hasCycle(node3) === true); +}); diff --git a/solutions/loggerRateLimiter.test.ts b/solutions/loggerRateLimiter.test.ts deleted file mode 100644 index 6824a07..0000000 --- a/solutions/loggerRateLimiter.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import Logger from "./loggerRateLimiter"; - -describe("359. Logger Rate Limiter", () => { - describe("Logger#shouldPrintMessage", () => { - it("returns boolean value by usage until the time", () => { - const logger = new Logger(); - - expect(logger.shouldPrintMessage(1, "foo")).toBe(true); - expect(logger.shouldPrintMessage(2, "bar")).toBe(true); - expect(logger.shouldPrintMessage(3, "foo")).toBe(false); - expect(logger.shouldPrintMessage(8, "bar")).toBe(false); - expect(logger.shouldPrintMessage(10, "foo")).toBe(false); - expect(logger.shouldPrintMessage(11, "foo")).toBe(true); - }); - }); -}); diff --git a/solutions/loggerRateLimiter.ts b/solutions/logger_rate_limiter.ts similarity index 92% rename from solutions/loggerRateLimiter.ts rename to solutions/logger_rate_limiter.ts index d17cfd4..a72ba60 100644 --- a/solutions/loggerRateLimiter.ts +++ b/solutions/logger_rate_limiter.ts @@ -1,6 +1,6 @@ // 359. Logger Rate Limiter // https://leetcode.com/problems/logger-rate-limiter/ -class Logger { +export default class Logger { lastPrintedSecondEachMessage = new Map(); shouldPrintMessage(timestamp: number, message: string): boolean { @@ -15,5 +15,3 @@ class Logger { return false; } } - -export default Logger; diff --git a/solutions/logger_rate_limiter_test.ts b/solutions/logger_rate_limiter_test.ts new file mode 100644 index 0000000..39aeefc --- /dev/null +++ b/solutions/logger_rate_limiter_test.ts @@ -0,0 +1,14 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import Logger from "./logger_rate_limiter.ts"; + +test("359. Logger Rate Limiter", () => { + const logger = new Logger(); + + assert(logger.shouldPrintMessage(1, "foo") === true); + assert(logger.shouldPrintMessage(2, "bar") === true); + assert(logger.shouldPrintMessage(3, "foo") === false); + assert(logger.shouldPrintMessage(8, "bar") === false); + assert(logger.shouldPrintMessage(10, "foo") === false); + assert(logger.shouldPrintMessage(11, "foo") === true); +}); diff --git a/solutions/longestCommonPrefix.test.ts b/solutions/longestCommonPrefix.test.ts deleted file mode 100644 index 74878c6..0000000 --- a/solutions/longestCommonPrefix.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import longestCommonPrefix from "./longestCommonPrefix"; - -describe("14. Longest Common Prefix", () => { - const TEST_CASES = new Map([ - [["flower", "flow", "flight"], "fl"], - [["dog", "racecar", "car"], ""], - [["aca", "cba"], ""], - [[""], ""], - [["a"], "a"], - [["a", "b"], ""] - ]); - - for (const [strs, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${strs}]`, () => { - expect(longestCommonPrefix(strs)).toBe(expected); - }); - } -}); diff --git a/solutions/longestCommonPrefix.ts b/solutions/longest_common_prefix.ts similarity index 86% rename from solutions/longestCommonPrefix.ts rename to solutions/longest_common_prefix.ts index 5dc029a..8d603f6 100644 --- a/solutions/longestCommonPrefix.ts +++ b/solutions/longest_common_prefix.ts @@ -1,6 +1,6 @@ // 14. Longest Common Prefix // https://leetcode.com/problems/longest-common-prefix/ -function longestCommonPrefix(strs: string[]): string { +export default function longestCommonPrefix(strs: string[]): string { if (strs.length === 0) { return ""; } @@ -24,5 +24,3 @@ function longestCommonPrefix(strs: string[]): string { return base.slice(0, searchFrom); } - -export default longestCommonPrefix; diff --git a/solutions/longest_common_prefix_test.ts b/solutions/longest_common_prefix_test.ts new file mode 100644 index 0000000..eee1d5e --- /dev/null +++ b/solutions/longest_common_prefix_test.ts @@ -0,0 +1,12 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import longestCommonPrefix from "./longest_common_prefix.ts"; + +test("14. Longest Common Prefix", () => { + assert(longestCommonPrefix(["flower", "flow", "flight"]) === "fl"); + assert(longestCommonPrefix(["dog", "racecar", "car"]) === ""); + assert(longestCommonPrefix(["aca", "cba"]) === ""); + assert(longestCommonPrefix([""]) === ""); + assert(longestCommonPrefix(["a"]) === "a"); + assert(longestCommonPrefix(["a", "b"]) === ""); +}); diff --git a/solutions/longest_mountain_in_array.ts b/solutions/longest_mountain_in_array.ts new file mode 100644 index 0000000..bf553d9 --- /dev/null +++ b/solutions/longest_mountain_in_array.ts @@ -0,0 +1,34 @@ +// 845. Longest Mountain in Array +// https://leetcode.com/problems/longest-mountain-in-array/ +export default function longestMountain(a: number[]) { + let longestMountainLength = 0; + let mountainFrom = a.length; + + for (let i = 1; i < a.length; ++i) { + const beforePrevious = i >= 2 ? a[i - 2] : Infinity; + const previous = a[i - 1]; + const current = a[i]; + + // update mountainFrom to before when the previous is the foot of a mountain + if (current > previous && previous <= beforePrevious) { + mountainFrom = i - 1; + continue; + } + + // update mountainFrom to current when there's flat terrain between current and beforePrevious + if (current === previous || beforePrevious === previous) { + mountainFrom = i; + continue; + } + + // start counting mountain length in down trend + if (current < previous) { + longestMountainLength = Math.max( + longestMountainLength, + i - mountainFrom + 1 + ); + } + } + + return longestMountainLength >= 3 ? longestMountainLength : 0; +} diff --git a/solutions/longest_mountain_in_array_test.ts b/solutions/longest_mountain_in_array_test.ts new file mode 100644 index 0000000..17f368c --- /dev/null +++ b/solutions/longest_mountain_in_array_test.ts @@ -0,0 +1,11 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import longestMountain from "./longest_mountain_in_array.ts"; + +test("845. Longest Mountain in Array", () => { + assert(longestMountain([2, 1, 4, 7, 3, 2, 5]) === 5); + assert(longestMountain([0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0]) === 11); + assert(longestMountain([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) === 0); + assert(longestMountain([1, 1, 0, 0, 1, 0]) === 3); + assert(longestMountain([2, 3, 3, 2, 0, 2]) === 0); +}); diff --git a/solutions/longestPalindrome.ts b/solutions/longest_palindrome.ts similarity index 100% rename from solutions/longestPalindrome.ts rename to solutions/longest_palindrome.ts diff --git a/solutions/longestPalindrome.test.ts b/solutions/longest_palindrome_test.ts similarity index 62% rename from solutions/longestPalindrome.test.ts rename to solutions/longest_palindrome_test.ts index c902f1b..78ed4a2 100644 --- a/solutions/longestPalindrome.test.ts +++ b/solutions/longest_palindrome_test.ts @@ -1,20 +1,19 @@ -import longestPalindrome from "./longestPalindrome"; +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import longestPalindrome from "./longest_palindrome.ts"; -describe("409. Longest Palindrome", () => { - const TEST_CASES = new Map([ - ["abccccdd", 7], - ["bb", 2], - ["aaaAaaaa", 7], - ["zeusnilemacaronimaisanitratetartinasiaminoracamelinsuez", 55], - [ - "civilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattdafskremainingbeforeusthatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhichtheygavethelastpfullmeasureofdevotionthatweherehighlyresolvethatthesedeadshallnothavediedinvainthatthisnationunsderGodshallhaveanewbirthoffreedomandthatgovernmentofthepeoplebythepeopleforthepeopleshallnotperishfromtheearth", - 983 - ] - ]); - - for (const [s, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${s}`, () => { - expect(longestPalindrome(s)).toBe(expected); - }); - } +test("409. Longest Palindrome", () => { + assert(longestPalindrome("abccccdd") === 7); + assert(longestPalindrome("bb") === 2); + assert(longestPalindrome("aaaAaaaa") === 7); + assert( + longestPalindrome( + "zeusnilemacaronimaisanitratetartinasiaminoracamelinsuez" + ) === 55 + ); + assert( + longestPalindrome( + "civilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattdafskremainingbeforeusthatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhichtheygavethelastpfullmeasureofdevotionthatweherehighlyresolvethatthesedeadshallnothavediedinvainthatthisnationunsderGodshallhaveanewbirthoffreedomandthatgovernmentofthepeoplebythepeopleforthepeopleshallnotperishfromtheearth" + ) === 983 + ); }); diff --git a/solutions/lruCache.test.ts b/solutions/lruCache.test.ts deleted file mode 100644 index 27b1164..0000000 --- a/solutions/lruCache.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import LRUCache from "./lruCache"; - -describe("146. LRU Cache", () => { - const TEST_CASES = new Map<[string[], number[][]], (number | void)[]>([ - [ - [ - [ - "LRUCache", - "put", - "put", - "get", - "put", - "get", - "put", - "get", - "get", - "get" - ], - [[2], [1, 1], [2, 2], [1], [3, 3], [2], [4, 4], [1], [3], [4]] - ], - [undefined, undefined, undefined, 1, undefined, -1, undefined, -1, 3, 4] - ], - [ - [ - ["LRUCache", "put", "put", "put", "put", "get", "get"], - [[2], [2, 1], [1, 1], [2, 3], [4, 1], [1], [2]] - ], - [undefined, undefined, undefined, undefined, undefined, -1, 3] - ] - ]); - - for (const [ - [operations, operationArgs], - expectedValuesEachOperation - ] of TEST_CASES) { - it(`manages key-value pairs with fixed sized space`, () => { - let cache: LRUCache; - - for (const i of operations.keys()) { - switch (operations[i]) { - case "LRUCache": - cache = new LRUCache(operationArgs[i][0]); - break; - case "put": - cache!.put(operationArgs[i][0], operationArgs[i][1]); - break; - case "get": - expect(cache!.get(operationArgs[i][0])).toBe( - expectedValuesEachOperation[i] - ); - break; - } - } - }); - } -}); diff --git a/solutions/lruCache.ts b/solutions/lru_cache.ts similarity index 95% rename from solutions/lruCache.ts rename to solutions/lru_cache.ts index 1b5942e..b49ff3d 100644 --- a/solutions/lruCache.ts +++ b/solutions/lru_cache.ts @@ -1,6 +1,6 @@ // 146. LRU Cache // https://leetcode.com/problems/lru-cache/ -class LRUCache { +export default class LRUCache { constructor(capacity: number) { this.capacity = capacity; } @@ -33,5 +33,3 @@ class LRUCache { this.cache.set(key, value); } } - -export default LRUCache; diff --git a/solutions/lru_cache_test.ts b/solutions/lru_cache_test.ts new file mode 100644 index 0000000..d45997a --- /dev/null +++ b/solutions/lru_cache_test.ts @@ -0,0 +1,26 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import LRUCache from "./lru_cache.ts"; + +test("146. LRU Cache", () => { + const lru1 = new LRUCache(2); + + lru1.put(1, 1); + lru1.put(2, 2); + assert(lru1.get(1) === 1); + lru1.put(3, 3); + assert(lru1.get(2) === -1); + lru1.put(4, 4); + assert(lru1.get(1) === -1); + assert(lru1.get(3) === 3); + assert(lru1.get(4) === 4); + + const lru2 = new LRUCache(2); + + lru2.put(2, 1); + lru2.put(1, 1); + lru2.put(2, 3); + lru2.put(4, 1); + assert(lru2.get(1) === -1); + assert(lru2.get(2) === 3); +}); diff --git a/solutions/majorityElement.test.ts b/solutions/majorityElement.test.ts deleted file mode 100644 index 6d23ea1..0000000 --- a/solutions/majorityElement.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import majorityElement from "./majorityElement"; - -describe("169. Majority Element", () => { - const TEST_CASES = new Map([[[3, 2, 3], 3], [[2, 2, 1, 1, 1, 2, 2], 2]]); - - for (const [nums, expected] of TEST_CASES) { - it(`returns ${expected} when calling with [${nums}]`, () => { - expect(majorityElement(nums)).toBe(expected); - }); - } -}); diff --git a/solutions/majorityElement.ts b/solutions/majority_element.ts similarity index 100% rename from solutions/majorityElement.ts rename to solutions/majority_element.ts diff --git a/solutions/majority_element_test.ts b/solutions/majority_element_test.ts new file mode 100644 index 0000000..9a8feef --- /dev/null +++ b/solutions/majority_element_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import majorityElement from "./majority_element.ts"; + +test("169. Majority Element", () => { + assert(majorityElement([3, 2, 3]) === 3); + assert(majorityElement([2, 2, 1, 1, 1, 2, 2]) === 2); +}); diff --git a/solutions/maxAreaOfIsland.test.ts b/solutions/maxAreaOfIsland.test.ts deleted file mode 100644 index edcb062..0000000 --- a/solutions/maxAreaOfIsland.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import maxAreaOfIsland from "./maxAreaOfIsland"; - -describe("695. Max Area of Island", () => { - const TEST_CASES = new Map<(1 | 0)[][], number>([ - [ - [ - [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], - [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], - [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0], - [0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0] - ], - 6 - ], - [[[1, 1, 0, 0, 0], [1, 1, 0, 0, 0], [0, 0, 0, 1, 1], [0, 0, 0, 1, 1]], 4], - [[[0, 0, 0, 0, 0, 0, 0, 0]], 0] - ]); - - for (const [grid, expected] of TEST_CASES) { - it(`returns ${expected} when called with some ${grid[0].length}x${grid.length} grid`, () => { - expect(maxAreaOfIsland(grid)).toBe(expected); - }); - } -}); diff --git a/solutions/maxAreaOfIsland.ts b/solutions/max_area_of_island.ts similarity index 100% rename from solutions/maxAreaOfIsland.ts rename to solutions/max_area_of_island.ts diff --git a/solutions/max_area_of_island_test.ts b/solutions/max_area_of_island_test.ts new file mode 100644 index 0000000..e77c43a --- /dev/null +++ b/solutions/max_area_of_island_test.ts @@ -0,0 +1,27 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import maxAreaOfIsland from "./max_area_of_island.ts"; + +test("695. Max Area of Island", () => { + assert( + maxAreaOfIsland([ + [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], + [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0], + [0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0] + ]) === 6 + ); + assert( + maxAreaOfIsland([ + [1, 1, 0, 0, 0], + [1, 1, 0, 0, 0], + [0, 0, 0, 1, 1], + [0, 0, 0, 1, 1] + ]) === 4 + ); + assert(maxAreaOfIsland([[0, 0, 0, 0, 0, 0, 0, 0]]) === 0); +}); diff --git a/solutions/maximumDepthOfBinaryTree.test.ts b/solutions/maximumDepthOfBinaryTree.test.ts deleted file mode 100644 index 350b76d..0000000 --- a/solutions/maximumDepthOfBinaryTree.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import maxDepth from "./maximumDepthOfBinaryTree"; - -describe("104. Maximum Depth of Binary Tree", () => { - const TEST_CASES = new Map([[[3, 9, 20, null, null, 15, 7], 3], [[], 0]]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(maxDepth(createBinaryTreeNode(values))).toBe(expected); - }); - } -}); diff --git a/solutions/maximumLengthOfPairChain.test.ts b/solutions/maximumLengthOfPairChain.test.ts deleted file mode 100644 index e74a566..0000000 --- a/solutions/maximumLengthOfPairChain.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import findLongestChain from "./maximumLengthOfPairChain"; - -describe("646. Maximum Length of Pair Chain", () => { - const TEST_CASES = new Map<[number, number][], number>([ - [[[1, 2], [2, 3], [3, 4]], 2], - [[[3, 4], [2, 3], [1, 2]], 2], - [[[1, 2]], 1] - ]); - - for (const [pairs, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${pairs}]`, () => { - expect(findLongestChain(pairs)).toBe(expected); - }); - } -}); diff --git a/solutions/maximumSubarray.test.ts b/solutions/maximumSubarray.test.ts deleted file mode 100644 index 157ec74..0000000 --- a/solutions/maximumSubarray.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import maxSubArray from "./maximumSubarray"; - -describe("53. Maximum Subarray", () => { - const TEST_CASES = new Map([ - [[-2, 1, -3, 4, -1, 2, 1, -5, 4], 6], - [[-3, -2, -5, -1, -4, -1], -1] - ]); - - for (const [nums, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${nums}]`, () => { - expect(maxSubArray(nums)).toBe(expected); - }); - } -}); diff --git a/solutions/maximumDepthOfBinaryTree.ts b/solutions/maximum_depth_of_binary_tree.ts similarity index 82% rename from solutions/maximumDepthOfBinaryTree.ts rename to solutions/maximum_depth_of_binary_tree.ts index bb1ace3..fdeedca 100644 --- a/solutions/maximumDepthOfBinaryTree.ts +++ b/solutions/maximum_depth_of_binary_tree.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 104. Maximum Depth of Binary Tree // https://leetcode.com/problems/maximum-depth-of-binary-tree/ diff --git a/solutions/maximum_depth_of_binary_tree_test.ts b/solutions/maximum_depth_of_binary_tree_test.ts new file mode 100644 index 0000000..c364732 --- /dev/null +++ b/solutions/maximum_depth_of_binary_tree_test.ts @@ -0,0 +1,9 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import maxDepth from "./maximum_depth_of_binary_tree.ts"; + +test("104. Maximum Depth of Binary Tree", () => { + assert(maxDepth(createBinaryTreeNode([3, 9, 20, null, null, 15, 7])) === 3); + assert(maxDepth(createBinaryTreeNode([])) === 0); +}); diff --git a/solutions/maximumLengthOfPairChain.ts b/solutions/maximum_length_of_pair_chain.ts similarity index 100% rename from solutions/maximumLengthOfPairChain.ts rename to solutions/maximum_length_of_pair_chain.ts diff --git a/solutions/maximum_length_of_pair_chain_test.ts b/solutions/maximum_length_of_pair_chain_test.ts new file mode 100644 index 0000000..43f7e5d --- /dev/null +++ b/solutions/maximum_length_of_pair_chain_test.ts @@ -0,0 +1,9 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import findLongestChain from "./maximum_length_of_pair_chain.ts"; + +test("646. Maximum Length of Pair Chain", () => { + assert(findLongestChain([[1, 2], [2, 3], [3, 4]]) === 2); + assert(findLongestChain([[3, 4], [2, 3], [1, 2]]) === 2); + assert(findLongestChain([[1, 2]]) === 1); +}); diff --git a/solutions/maximumSubarray.ts b/solutions/maximum_subarray.ts similarity index 79% rename from solutions/maximumSubarray.ts rename to solutions/maximum_subarray.ts index 0e4f4a1..aac83c3 100644 --- a/solutions/maximumSubarray.ts +++ b/solutions/maximum_subarray.ts @@ -1,6 +1,6 @@ // 53. Maximum Subarray // https://leetcode.com/problems/maximum-subarray/ -function maxSubArray(nums: number[]): number { +export default function maxSubArray(nums: number[]): number { let current = nums[0]; let max = current; @@ -14,5 +14,3 @@ function maxSubArray(nums: number[]): number { return max; } - -export default maxSubArray; diff --git a/solutions/maximum_subarray_test.ts b/solutions/maximum_subarray_test.ts new file mode 100644 index 0000000..a850fcc --- /dev/null +++ b/solutions/maximum_subarray_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import maxSubArray from "./maximum_subarray.ts"; + +test("53. Maximum Subarray", () => { + assert(maxSubArray([-2, 1, -3, 4, -1, 2, 1, -5, 4]) === 6); + assert(maxSubArray([-3, -2, -5, -1, -4, -1]) === -1); +}); diff --git a/solutions/mergeSortedArray.test.ts b/solutions/mergeSortedArray.test.ts deleted file mode 100644 index 6cca81a..0000000 --- a/solutions/mergeSortedArray.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import merge from "./mergeSortedArray"; - -describe("88. Merge Sorted Array", () => { - const TEST_CASES = new Map<[number[], number, number[], number], number[]>([ - [[[1, 2, 3, 0, 0, 0], 3, [2, 5, 6], 3], [1, 2, 2, 3, 5, 6]], - [[[1, 2, 5, 0, 0, 0], 3, [3, 4, 6], 3], [1, 2, 3, 4, 5, 6]], - [[[1, 2, 5, 0, 0, 0], 3, [3], 1], [1, 2, 3, 5]], - [[[4, 0, 0, 0], 1, [1, 2, 3], 3], [1, 2, 3, 4]], - [[[0, 0, 0], 0, [1, 2, 3], 3], [1, 2, 3]], - [[[1, 2, 3], 3, [], 0], [1, 2, 3]], - [[[], 0, [], 0], []] - ]); - - for (const [[nums1, m, nums2, n], expected] of TEST_CASES) { - it(`merges in-placely [${nums2}] (length=${n}) into [${nums1}] (length=${m})`, () => { - const nums = [...nums1]; - const result = merge(nums, m, nums2, n); - - expect(result).toEqual(expected); - expect(result).toBe(nums); - }); - } -}); diff --git a/solutions/mergeTwoLists.test.ts b/solutions/mergeTwoLists.test.ts deleted file mode 100644 index 6ba0818..0000000 --- a/solutions/mergeTwoLists.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { createSinglyLinkedListNode } from "../testUtilities/LinkedList"; -import mergeTwoLists from "./mergeTwoLists"; - -describe("21. Merge Two Sorted Lists", () => { - const TEST_CASES = new Map([ - [[[1, 2, 4], [1, 3, 4]], [1, 1, 2, 3, 4, 4]], - [[[], []], []] - ]); - - for (const [[list1, list2], expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${list1}] and [${list2}]`, () => { - expect( - mergeTwoLists( - createSinglyLinkedListNode(list1), - createSinglyLinkedListNode(list2) - ) - ).toEqual(createSinglyLinkedListNode(expected)); - }); - } -}); diff --git a/solutions/mergeSortedArray.ts b/solutions/merge_sorted_array.ts similarity index 94% rename from solutions/mergeSortedArray.ts rename to solutions/merge_sorted_array.ts index cade26a..3d3bf8b 100644 --- a/solutions/mergeSortedArray.ts +++ b/solutions/merge_sorted_array.ts @@ -1,6 +1,6 @@ // 88. Merge Sorted Array // https://leetcode.com/problems/merge-sorted-array/ -function merge( +export default function merge( nums1: number[], m: number, nums2: number[], @@ -28,5 +28,3 @@ function merge( return nums1; } - -export default merge; diff --git a/solutions/merge_sorted_array_test.ts b/solutions/merge_sorted_array_test.ts new file mode 100644 index 0000000..92f2500 --- /dev/null +++ b/solutions/merge_sorted_array_test.ts @@ -0,0 +1,13 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import merge from "./merge_sorted_array.ts"; + +test("88. Merge Sorted Array", () => { + assertEquals(merge([1, 2, 3, 0, 0, 0], 3, [2, 5, 6], 3), [1, 2, 2, 3, 5, 6]); + assertEquals(merge([1, 2, 5, 0, 0, 0], 3, [3, 4, 6], 3), [1, 2, 3, 4, 5, 6]); + assertEquals(merge([1, 2, 5, 0, 0, 0], 3, [3], 1), [1, 2, 3, 5]); + assertEquals(merge([4, 0, 0, 0], 1, [1, 2, 3], 3), [1, 2, 3, 4]); + assertEquals(merge([0, 0, 0], 0, [1, 2, 3], 3), [1, 2, 3]); + assertEquals(merge([1, 2, 3], 3, [], 0), [1, 2, 3]); + assertEquals(merge([], 0, [], 0), []); +}); diff --git a/solutions/mergeTwoLists.ts b/solutions/merge_two_lists.ts similarity index 79% rename from solutions/mergeTwoLists.ts rename to solutions/merge_two_lists.ts index dfee38a..ce76d30 100644 --- a/solutions/mergeTwoLists.ts +++ b/solutions/merge_two_lists.ts @@ -1,8 +1,8 @@ -import { SinglyLinkedListNode } from "../types/LinkedList"; +import { SinglyLinkedListNode } from "../types/linked_list.ts"; // 21. Merge Two Sorted Lists // https://leetcode.com/problems/merge-two-sorted-lists/ -function mergeTwoLists( +export default function mergeTwoLists( list1: SinglyLinkedListNode | null, list2: SinglyLinkedListNode | null ): SinglyLinkedListNode | null { @@ -24,5 +24,3 @@ function mergeTwoLists( return list2; } - -export default mergeTwoLists; diff --git a/solutions/merge_two_lists_test.ts b/solutions/merge_two_lists_test.ts new file mode 100644 index 0000000..63ffe39 --- /dev/null +++ b/solutions/merge_two_lists_test.ts @@ -0,0 +1,21 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { createSinglyLinkedListNode } from "../test_utilities/linked_list.ts"; +import mergeTwoLists from "./merge_two_lists.ts"; + +test("21. Merge Two Sorted Lists", () => { + assertEquals( + mergeTwoLists( + createSinglyLinkedListNode([1, 2, 4]), + createSinglyLinkedListNode([1, 3, 4]) + ), + createSinglyLinkedListNode([1, 1, 2, 3, 4, 4]) + ); + assertEquals( + mergeTwoLists( + createSinglyLinkedListNode([]), + createSinglyLinkedListNode([]) + ), + createSinglyLinkedListNode([]) + ); +}); diff --git a/solutions/minCostClimbingStairs.test.ts b/solutions/minCostClimbingStairs.test.ts deleted file mode 100644 index eecc0a6..0000000 --- a/solutions/minCostClimbingStairs.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import minCostClimbingStairs from "./minCostClimbingStairs"; - -describe("746. Min Cost Climbing Stairs", () => { - const TEST_CASES = new Map([ - [[10, 15, 20], 15], - [[1, 100, 1, 1, 1, 100, 1, 1, 100, 1], 6] - ]); - - for (const [costs, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${costs}]`, () => { - expect(minCostClimbingStairs(costs)).toBe(expected); - }); - } -}); diff --git a/solutions/minStack.test.ts b/solutions/minStack.test.ts deleted file mode 100644 index 7981384..0000000 --- a/solutions/minStack.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import MinStack from "./minStack"; - -describe("155. Min Stack", () => { - test("#1", () => { - const minStack = new MinStack(); - minStack.push(-2); - minStack.push(0); - minStack.push(-3); - expect(minStack.getMin()).toBe(-3); - minStack.pop(); - expect(minStack.top()).toBe(0); - expect(minStack.getMin()).toBe(-2); - }); -}); diff --git a/solutions/minCostClimbingStairs.ts b/solutions/min_cost_climbing_stairs.ts similarity index 80% rename from solutions/minCostClimbingStairs.ts rename to solutions/min_cost_climbing_stairs.ts index 2f3bd68..d3f3602 100644 --- a/solutions/minCostClimbingStairs.ts +++ b/solutions/min_cost_climbing_stairs.ts @@ -1,6 +1,6 @@ // 746. Min Cost Climbing Stairs // https://leetcode.com/problems/min-cost-climbing-stairs/ -function minCostClimbingStairs(costs: number[]): number { +export default function minCostClimbingStairs(costs: number[]): number { // this is dynamic programming. // see https://github.com/axross/leetcode-typescript/pull/58 const dp = new Map([[-2, 0], [-1, 0]]); @@ -11,5 +11,3 @@ function minCostClimbingStairs(costs: number[]): number { return dp.get(costs.length)!; } - -export default minCostClimbingStairs; diff --git a/solutions/min_cost_climbing_stairs_test.ts b/solutions/min_cost_climbing_stairs_test.ts new file mode 100644 index 0000000..1186bca --- /dev/null +++ b/solutions/min_cost_climbing_stairs_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import minCostClimbingStairs from "./min_cost_climbing_stairs.ts"; + +test("746. Min Cost Climbing Stairs", () => { + assert(minCostClimbingStairs([10, 15, 20]) === 15); + assert(minCostClimbingStairs([1, 100, 1, 1, 1, 100, 1, 1, 100, 1]) === 6); +}); diff --git a/solutions/minStack.ts b/solutions/min_stack.ts similarity index 94% rename from solutions/minStack.ts rename to solutions/min_stack.ts index 2c6e637..fbeb647 100644 --- a/solutions/minStack.ts +++ b/solutions/min_stack.ts @@ -1,6 +1,6 @@ // 155. Min Stack // https://leetcode.com/problems/min-stack/ -class MinStack { +export default class MinStack { stack: number[] = []; stackInOrder: number[] = []; @@ -31,5 +31,3 @@ class MinStack { return this.stackInOrder[this.stackInOrder.length - 1]; } } - -export default MinStack; diff --git a/solutions/min_stack_test.ts b/solutions/min_stack_test.ts new file mode 100644 index 0000000..56669f1 --- /dev/null +++ b/solutions/min_stack_test.ts @@ -0,0 +1,14 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import MinStack from "./min_stack.ts"; + +test("155. Min Stack", () => { + const minStack = new MinStack(); + minStack.push(-2); + minStack.push(0); + minStack.push(-3); + assert(minStack.getMin() === -3); + minStack.pop(); + assert(minStack.top() === 0); + assert(minStack.getMin() === -2); +}); diff --git a/solutions/minimumDepthOfBinaryTree.test.ts b/solutions/minimumDepthOfBinaryTree.test.ts deleted file mode 100644 index 15d0904..0000000 --- a/solutions/minimumDepthOfBinaryTree.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import minDepth from "./minimumDepthOfBinaryTree"; - -describe("111. Minimum Depth of Binary Tree", () => { - const TEST_CASES = new Map([ - [[3, 9, 20, null, null, 15, 7], 2], - [[1, 2], 2], - [[1, null, 2, null, 2], 3], - [[1], 1], - [[], 0] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(minDepth(createBinaryTreeNode(values))).toBe(expected); - }); - } -}); diff --git a/solutions/minimumDepthOfBinaryTree.ts b/solutions/minimum_depth_of_binary_tree.ts similarity index 89% rename from solutions/minimumDepthOfBinaryTree.ts rename to solutions/minimum_depth_of_binary_tree.ts index 86d41a3..147aafd 100644 --- a/solutions/minimumDepthOfBinaryTree.ts +++ b/solutions/minimum_depth_of_binary_tree.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 111. Minimum Depth of Binary Tree // https://leetcode.com/problems/minimum-depth-of-binary-tree/ diff --git a/solutions/minimum_depth_of_binary_tree_test.ts b/solutions/minimum_depth_of_binary_tree_test.ts new file mode 100644 index 0000000..6b10ad6 --- /dev/null +++ b/solutions/minimum_depth_of_binary_tree_test.ts @@ -0,0 +1,12 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import minDepth from "./minimum_depth_of_binary_tree.ts"; + +test("111. Minimum Depth of Binary Tree", () => { + assert(minDepth(createBinaryTreeNode([3, 9, 20, null, null, 15, 7])) === 2); + assert(minDepth(createBinaryTreeNode([1, 2])) === 2); + assert(minDepth(createBinaryTreeNode([1, null, 2, null, 2])) === 3); + assert(minDepth(createBinaryTreeNode([1])) === 1); + assert(minDepth(createBinaryTreeNode([])) === 0); +}); diff --git a/solutions/mostCommonWord.test.ts b/solutions/mostCommonWord.test.ts deleted file mode 100644 index e837136..0000000 --- a/solutions/mostCommonWord.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import mostCommonWord from "./mostCommonWord"; - -describe("819. Most Common Word", () => { - const TEST_CASES = new Map<[string, string[]], string>([ - [ - ["Bob hit a ball, the hit BALL flew far after it was hit.", ["hit"]], - "ball" - ], - [["Bob hit a ball, the hit BALL flew far after it was hit.", []], "hit"], - [["Bob", []], "bob"], - [["a, a, a, a, b,b,b,c, c", ["a"]], "b"] - ]); - - for (const [[paragraph, banned], expected] of TEST_CASES) { - it(`returns ${expected} when called with ${paragraph} with [${banned}]`, () => { - expect(mostCommonWord(paragraph, banned)).toBe(expected); - }); - } -}); diff --git a/solutions/mostCommonWord.ts b/solutions/most_common_word.ts similarity index 87% rename from solutions/mostCommonWord.ts rename to solutions/most_common_word.ts index 2d5f2a1..b4ebc7b 100644 --- a/solutions/mostCommonWord.ts +++ b/solutions/most_common_word.ts @@ -1,6 +1,9 @@ // 819. Most Common Word // https://leetcode.com/problems/most-common-word/ -function mostCommonWord(paragraph: string, banned: string[]): string { +export default function mostCommonWord( + paragraph: string, + banned: string[] +): string { const lowercase = paragraph.toLowerCase(); // split lowercase paragpraph into words (by non a-z characters) const words = lowercase.split(/[^a-z]+/); @@ -24,5 +27,3 @@ function mostCommonWord(paragraph: string, banned: string[]): string { return mostFrequentWord; } - -export default mostCommonWord; diff --git a/solutions/most_common_word_test.ts b/solutions/most_common_word_test.ts new file mode 100644 index 0000000..3ee7260 --- /dev/null +++ b/solutions/most_common_word_test.ts @@ -0,0 +1,19 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import mostCommonWord from "./most_common_word.ts"; + +test("819. Most Common Word", () => { + assert( + mostCommonWord("Bob hit a ball, the hit BALL flew far after it was hit.", [ + "hit" + ]) === "ball" + ); + assert( + mostCommonWord( + "Bob hit a ball, the hit BALL flew far after it was hit.", + [] + ) === "hit" + ); + assert(mostCommonWord("Bob", []) === "bob"); + assert(mostCommonWord("a, a, a, a, b,b,b,c, c", ["a"]) === "b"); +}); diff --git a/solutions/moveZeroes.test.ts b/solutions/moveZeroes.test.ts deleted file mode 100644 index ff32efe..0000000 --- a/solutions/moveZeroes.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import moveZeroes from "./moveZeroes"; - -describe("283. Move Zeroes", () => { - const TEST_CASES = new Map([[[0, 1, 0, 3, 12], [1, 3, 12, 0, 0]]]); - - for (const [nums, expected] of TEST_CASES) { - it(`moves zeroes to the tail for [${nums}] to be [${expected}]`, () => { - const array = [...nums]; - - moveZeroes(array); - - expect(array).toEqual(expected); - }); - } -}); diff --git a/solutions/moveZeroes.ts b/solutions/move_zeroes.ts similarity index 86% rename from solutions/moveZeroes.ts rename to solutions/move_zeroes.ts index d8d5ac8..19dd866 100644 --- a/solutions/moveZeroes.ts +++ b/solutions/move_zeroes.ts @@ -1,6 +1,6 @@ // 283. Move Zeroes // https://leetcode.com/problems/move-zeroes/ -function moveZeroes(nums: number[]): void { +export default function moveZeroes(nums: number[]): void { let deleted = 0; let i = 0; @@ -24,5 +24,3 @@ function moveZeroes(nums: number[]): void { nums.push(0); } } - -export default moveZeroes; diff --git a/solutions/move_zeroes_test.ts b/solutions/move_zeroes_test.ts new file mode 100644 index 0000000..c930238 --- /dev/null +++ b/solutions/move_zeroes_test.ts @@ -0,0 +1,11 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import moveZeroes from "./move_zeroes.ts"; + +test("283. Move Zeroes", () => { + const values = [0, 1, 0, 3, 12]; + + moveZeroes(values); + + assertEquals(values, [1, 3, 12, 0, 0]); +}); diff --git a/solutions/paintHouse.test.ts b/solutions/paintHouse.test.ts deleted file mode 100644 index 6b345b4..0000000 --- a/solutions/paintHouse.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import minCost from "./paintHouse"; - -describe("256. Paint House", () => { - const TEST_CASES = new Map<[number, number, number][], number>([ - [[[17, 2, 17], [16, 16, 5], [14, 3, 19]], 10], - [[[17, 2, 17], [16, 16, 5], [30, 3, 19], [4, 8, 2], [10, 15, 11]], 22], - [[[5, 8, 6], [19, 14, 13], [7, 5, 12], [14, 15, 17], [3, 20, 10]], 43], - [[[5, 8, 6], [19, 14, 13], [7, 5, 12], [14, 15, 20], [3, 20, 10]], 43] - ]); - - for (const [houses, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${houses.map( - house => `[${house}]` - )}]`, () => { - expect(minCost(houses)).toEqual(expected); - }); - } -}); diff --git a/solutions/paintHouse.ts b/solutions/paint_house.ts similarity index 89% rename from solutions/paintHouse.ts rename to solutions/paint_house.ts index c779077..70795b0 100644 --- a/solutions/paintHouse.ts +++ b/solutions/paint_house.ts @@ -1,6 +1,6 @@ // 256. Paint House // https://leetcode.com/problems/paint-house/ -function minCost(costs: [number, number, number][]): number { +export default function minCost(costs: [number, number, number][]): number { // this is dynamic programming. // see https://github.com/axross/leetcode-typescript/pull/56 const dp = new Map([[-1, [0, 0, 0]]]); @@ -18,5 +18,3 @@ function minCost(costs: [number, number, number][]): number { // the minimum value in the end is the minimum cost return Math.min(...dp.get(costs.length - 1)!); } - -export default minCost; diff --git a/solutions/paint_house_test.ts b/solutions/paint_house_test.ts new file mode 100644 index 0000000..d91bdb5 --- /dev/null +++ b/solutions/paint_house_test.ts @@ -0,0 +1,34 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import minCost from "./paint_house.ts"; + +test("256. Paint House", () => { + assert(minCost([[17, 2, 17], [16, 16, 5], [14, 3, 19]]) === 10); + assert( + minCost([ + [17, 2, 17], + [16, 16, 5], + [30, 3, 19], + [4, 8, 2], + [10, 15, 11] + ]) === 22 + ); + assert( + minCost([ + [5, 8, 6], + [19, 14, 13], + [7, 5, 12], + [14, 15, 17], + [3, 20, 10] + ]) === 43 + ); + assert( + minCost([ + [5, 8, 6], + [19, 14, 13], + [7, 5, 12], + [14, 15, 20], + [3, 20, 10] + ]) === 43 + ); +}); diff --git a/solutions/palidromeNumber.test.ts b/solutions/palidromeNumber.test.ts deleted file mode 100644 index e9ccf59..0000000 --- a/solutions/palidromeNumber.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import isPalindrome from "./palidromeNumber"; - -describe("9. Palindrome Number", () => { - const TEST_CASES = new Map([ - [121, true], - [-121, false], - [5, true], - [0, true], - [10, false], - [101, true], - [1010, false] - ]); - - for (const [number, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${number}`, () => { - expect(isPalindrome(number)).toBe(expected); - }); - } -}); diff --git a/solutions/palidromeNumber.ts b/solutions/palidrome_number.ts similarity index 87% rename from solutions/palidromeNumber.ts rename to solutions/palidrome_number.ts index 118ba4e..f86110e 100644 --- a/solutions/palidromeNumber.ts +++ b/solutions/palidrome_number.ts @@ -1,6 +1,6 @@ // 9. Palindrome Number // https://leetcode.com/problems/palindrome-number/ -function isPalindrome(x: number): boolean { +export default function isPalindrome(x: number): boolean { if (x >= 0 && x <= 9) return true; if (x < 0) return false; @@ -22,5 +22,3 @@ function isPalindrome(x: number): boolean { return true; } - -export default isPalindrome; diff --git a/solutions/palidrome_number_test.ts b/solutions/palidrome_number_test.ts new file mode 100644 index 0000000..c0859af --- /dev/null +++ b/solutions/palidrome_number_test.ts @@ -0,0 +1,13 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import isPalindrome from "./palidrome_number.ts"; + +test("9. Palindrome Number", () => { + assert(isPalindrome(121) === true); + assert(isPalindrome(-121) === false); + assert(isPalindrome(5) === true); + assert(isPalindrome(0) === true); + assert(isPalindrome(10) === false); + assert(isPalindrome(101) === true); + assert(isPalindrome(1010) === false); +}); diff --git a/solutions/palindromeLinkedList.test.ts b/solutions/palindromeLinkedList.test.ts deleted file mode 100644 index a13a896..0000000 --- a/solutions/palindromeLinkedList.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createSinglyLinkedListNode } from "../testUtilities/LinkedList"; -import isPalindrome from "./palindromeLinkedList"; - -describe("234. Palindrome Linked List", () => { - const TEST_CASES = new Map([ - [[1, 2], false], - [[1, 2, 2, 1], true], - [[1, 2, 1, 3, 1, 2, 1], true], - [[1, 2, 1, 3, 1, 3, 1], false] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(isPalindrome(createSinglyLinkedListNode(values))).toBe(expected); - }); - } -}); diff --git a/solutions/palindromeLinkedList.ts b/solutions/palindrome_linked_list.ts similarity index 90% rename from solutions/palindromeLinkedList.ts rename to solutions/palindrome_linked_list.ts index d1e689a..fb62ed7 100644 --- a/solutions/palindromeLinkedList.ts +++ b/solutions/palindrome_linked_list.ts @@ -1,4 +1,4 @@ -import { SinglyLinkedListNode } from "../types/LinkedList"; +import { SinglyLinkedListNode } from "../types/linked_list.ts"; // 234. Palindrome Linked List // https://leetcode.com/problems/palindrome-linked-list/ diff --git a/solutions/palindrome_linked_list_test.ts b/solutions/palindrome_linked_list_test.ts new file mode 100644 index 0000000..6320fa5 --- /dev/null +++ b/solutions/palindrome_linked_list_test.ts @@ -0,0 +1,15 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createSinglyLinkedListNode } from "../test_utilities/linked_list.ts"; +import isPalindrome from "./palindrome_linked_list.ts"; + +test("234. Palindrome Linked List", () => { + assert(isPalindrome(createSinglyLinkedListNode([1, 2])) === false); + assert(isPalindrome(createSinglyLinkedListNode([1, 2, 2, 1])) === true); + assert( + isPalindrome(createSinglyLinkedListNode([1, 2, 1, 3, 1, 2, 1])) === true + ); + assert( + isPalindrome(createSinglyLinkedListNode([1, 2, 1, 3, 1, 3, 1])) === false + ); +}); diff --git a/solutions/partitionEqualSubsetSum.test.ts b/solutions/partitionEqualSubsetSum.test.ts deleted file mode 100644 index e633560..0000000 --- a/solutions/partitionEqualSubsetSum.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import canPartition from "./partitionEqualSubsetSum"; - -describe("416. Partition Equal Subset Sum", () => { - const TEST_CASES = new Map([ - [[1, 5, 11, 5], true], - [[1, 2, 3, 5], false], - [[8, 6, 3, 4, 5], true] - ]); - - for (const [nums, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${nums}]`, () => { - expect(canPartition(nums)).toBe(expected); - }); - } -}); diff --git a/solutions/partitionEqualSubsetSum.ts b/solutions/partition_equal_subset_sum.ts similarity index 85% rename from solutions/partitionEqualSubsetSum.ts rename to solutions/partition_equal_subset_sum.ts index 2002de1..598e2f3 100644 --- a/solutions/partitionEqualSubsetSum.ts +++ b/solutions/partition_equal_subset_sum.ts @@ -1,6 +1,6 @@ // 416. Partition Equal Subset Sum // https://leetcode.com/problems/partition-equal-subset-sum/ -function canPartition(nums: number[]): boolean { +export default function canPartition(nums: number[]): boolean { const total = nums.reduce((total, num) => total + num, 0); if (total % 2 !== 0) return false; @@ -20,5 +20,3 @@ function canPartition(nums: number[]): boolean { return false; } - -export default canPartition; diff --git a/solutions/partition_equal_subset_sum_test.ts b/solutions/partition_equal_subset_sum_test.ts new file mode 100644 index 0000000..d7b8446 --- /dev/null +++ b/solutions/partition_equal_subset_sum_test.ts @@ -0,0 +1,9 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import canPartition from "./partition_equal_subset_sum.ts"; + +test("416. Partition Equal Subset Sum", () => { + assert(canPartition([1, 5, 11, 5]) === true); + assert(canPartition([1, 2, 3, 5]) === false); + assert(canPartition([8, 6, 3, 4, 5]) === true); +}); diff --git a/solutions/pathSum.test.ts b/solutions/pathSum.test.ts deleted file mode 100644 index 4a6142d..0000000 --- a/solutions/pathSum.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import pathSum from "./pathSum"; - -describe("112. Path Sum", () => { - const TEST_CASES = new Map<[(number | null)[], number], boolean>([ - [[[5, 4, 8, 11, null, 13, 4, 7, 2, null, null, null, 1], 22], true], - [[[5, 4, 8, 11, null, 13, 4, 7, 2, null, null, null, 1], 20], false], - [[[], 0], false] - ]); - - for (const [[values, sum], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}] and ${sum}`, () => { - expect(pathSum(createBinaryTreeNode(values), sum)).toBe(expected); - }); - } -}); diff --git a/solutions/pathSum.ts b/solutions/path_sum.ts similarity index 91% rename from solutions/pathSum.ts rename to solutions/path_sum.ts index e6877da..87cef5a 100644 --- a/solutions/pathSum.ts +++ b/solutions/path_sum.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 112. Path Sum // https://leetcode.com/problems/path-sum/ diff --git a/solutions/path_sum_test.ts b/solutions/path_sum_test.ts new file mode 100644 index 0000000..bc7236b --- /dev/null +++ b/solutions/path_sum_test.ts @@ -0,0 +1,48 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import pathSum from "./path_sum.ts"; + +test("112. Path Sum", () => { + assert( + pathSum( + createBinaryTreeNode([ + 5, + 4, + 8, + 11, + null, + 13, + 4, + 7, + 2, + null, + null, + null, + 1 + ]), + 22 + ) === true + ); + assert( + pathSum( + createBinaryTreeNode([ + 5, + 4, + 8, + 11, + null, + 13, + 4, + 7, + 2, + null, + null, + null, + 1 + ]), + 20 + ) === false + ); + assert(pathSum(createBinaryTreeNode([]), 0) === false); +}); diff --git a/solutions/perfectNumber.test.ts b/solutions/perfectNumber.test.ts deleted file mode 100644 index e696d63..0000000 --- a/solutions/perfectNumber.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import checkPerfectNumber from "./perfectNumber"; - -describe("507. Perfect Number", () => { - const TEST_CASES = new Map([ - [28, true], - [27, false], - [6, true], - [1, false], - [0, false] - ]); - - for (const [nums, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${nums}`, () => { - expect(checkPerfectNumber(nums)).toBe(expected); - }); - } -}); diff --git a/solutions/perfectNumber.ts b/solutions/perfect_number.ts similarity index 100% rename from solutions/perfectNumber.ts rename to solutions/perfect_number.ts diff --git a/solutions/perfect_number_test.ts b/solutions/perfect_number_test.ts new file mode 100644 index 0000000..faef4dc --- /dev/null +++ b/solutions/perfect_number_test.ts @@ -0,0 +1,11 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import checkPerfectNumber from "./perfect_number.ts"; + +test("507. Perfect Number", () => { + assert(checkPerfectNumber(28) === true); + assert(checkPerfectNumber(27) === false); + assert(checkPerfectNumber(6) === true); + assert(checkPerfectNumber(1) === false); + assert(checkPerfectNumber(0) === false); +}); diff --git a/solutions/plusOne.test.ts b/solutions/plusOne.test.ts deleted file mode 100644 index 41ab39d..0000000 --- a/solutions/plusOne.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import plusOne from "./plusOne"; - -describe("66. Plus One", () => { - const TEST_CASES = new Map([ - [[1, 2, 3], [1, 2, 4]], - [[1, 2, 9], [1, 3, 0]], - [[9, 9, 9], [1, 0, 0, 0]], - [ - [6, 1, 4, 5, 3, 9, 0, 1, 9, 5, 1, 8, 6, 7, 0, 5, 5, 4, 3], - [6, 1, 4, 5, 3, 9, 0, 1, 9, 5, 1, 8, 6, 7, 0, 5, 5, 4, 4] - ], - [[0], [1]], - [[9], [1, 0]] - ]); - - for (const [digits, expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${digits}]`, () => { - expect(plusOne(digits)).toEqual(expected); - }); - } -}); diff --git a/solutions/plusOne.ts b/solutions/plus_one.ts similarity index 83% rename from solutions/plusOne.ts rename to solutions/plus_one.ts index fe810a3..ad67200 100644 --- a/solutions/plusOne.ts +++ b/solutions/plus_one.ts @@ -1,6 +1,6 @@ // 66. Plus One // https://leetcode.com/problems/plus-one/ -function plusOne(digits: number[]): number[] { +export default function plusOne(digits: number[]): number[] { if (digits.length === 1) { return digits[0] <= 8 ? [digits[0] + 1] : [1, 0]; } @@ -13,5 +13,3 @@ function plusOne(digits: number[]): number[] { return [...digits.slice(0, -1), lastDigits[0]]; } } - -export default plusOne; diff --git a/solutions/plus_one_test.ts b/solutions/plus_one_test.ts new file mode 100644 index 0000000..be9e0da --- /dev/null +++ b/solutions/plus_one_test.ts @@ -0,0 +1,15 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import plusOne from "./plus_one.ts"; + +test("66. Plus One", () => { + assertEquals(plusOne([1, 2, 3]), [1, 2, 4]); + assertEquals(plusOne([1, 2, 9]), [1, 3, 0]); + assertEquals(plusOne([9, 9, 9]), [1, 0, 0, 0]); + assertEquals( + plusOne([6, 1, 4, 5, 3, 9, 0, 1, 9, 5, 1, 8, 6, 7, 0, 5, 5, 4, 3]), + [6, 1, 4, 5, 3, 9, 0, 1, 9, 5, 1, 8, 6, 7, 0, 5, 5, 4, 4] + ); + assertEquals(plusOne([0]), [1]); + assertEquals(plusOne([9]), [1, 0]); +}); diff --git a/solutions/rangeSumQueryImmutable.test.ts b/solutions/rangeSumQueryImmutable.test.ts deleted file mode 100644 index c2aa4b6..0000000 --- a/solutions/rangeSumQueryImmutable.test.ts +++ /dev/null @@ -1,134 +0,0 @@ -import NumArray from "./rangeSumQueryImmutable"; - -describe("303. Range Sum Query - Immutable", () => { - const TEST_CASES = new Map<[number[], [number, number][]], number[]>([ - [[[-2, 0, 3, -5, 2, -1], [[0, 2], [2, 5], [0, 5]]], [1, -1, -3]], - [ - [ - [ - -8261, - 2300, - -1429, - 6274, - 9650, - -3267, - 1414, - -8102, - 6251, - -5979, - -5291, - -4616, - -4703 - ], - [ - [0, 8], - [4, 5], - [9, 11], - [2, 11], - [0, 12], - [9, 12], - [2, 5], - [0, 9], - [5, 9], - [0, 1], - [12, 12], - [6, 7], - [5, 8], - [1, 1], - [6, 7], - [10, 11], - [11, 12], - [7, 8], - [4, 11], - [8, 9], - [4, 11], - [2, 9], - [2, 6], - [11, 12], - [5, 8], - [11, 11], - [1, 9], - [12, 12], - [10, 10], - [4, 7], - [12, 12], - [8, 10], - [7, 9], - [4, 7], - [0, 7], - [8, 9], - [10, 12], - [0, 9], - [10, 12], - [7, 12], - [9, 9], - [0, 12], - [1, 3], - [8, 8], - [7, 10] - ] - ], - [ - 4830, - 6383, - -15886, - -5095, - -15759, - -20589, - 11228, - -1149, - -9683, - -5961, - -4703, - -6688, - -3704, - 2300, - -6688, - -9907, - -9319, - -1851, - -9940, - 272, - -9940, - 4812, - 12642, - -9319, - -3704, - -4616, - 7112, - -4703, - -5291, - -305, - -4703, - -5019, - -7830, - -305, - -1421, - 272, - -14610, - -1149, - -14610, - -22440, - -5979, - -15759, - 7145, - 6251, - -13121 - ] - ] - ]); - - for (const [[initial, ranges], expectedValuesEachRange] of TEST_CASES) { - describe(`NumArray([${initial}])`, () => { - const numArray = new NumArray(initial); - - for (const i of ranges.keys()) { - it(`.sumRange(${ranges[i][0]}, ${ranges[i][1]}) returns ${expectedValuesEachRange[i]}`, () => { - expect(numArray.sumRange(ranges[i][0], ranges[i][1])).toBe( - expectedValuesEachRange[i] - ); - }); - } - }); - } -}); diff --git a/solutions/rangeSumQueryImmutable.ts b/solutions/range_sum_query_immutable.ts similarity index 91% rename from solutions/rangeSumQueryImmutable.ts rename to solutions/range_sum_query_immutable.ts index 1a0ae1b..ea506a0 100644 --- a/solutions/rangeSumQueryImmutable.ts +++ b/solutions/range_sum_query_immutable.ts @@ -1,6 +1,6 @@ // 303. Range Sum Query - Immutable // https://leetcode.com/problems/range-sum-query-immutable/ -class NumArray { +export default class NumArray { constructor(nums: number[]) { let total = 0; @@ -19,5 +19,3 @@ class NumArray { return this.sums[j] - (this.sums[i - 1] || 0); } } - -export default NumArray; diff --git a/solutions/range_sum_query_immutable_test.ts b/solutions/range_sum_query_immutable_test.ts new file mode 100644 index 0000000..6fabd6b --- /dev/null +++ b/solutions/range_sum_query_immutable_test.ts @@ -0,0 +1,774 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import NumArray from "./range_sum_query_immutable.ts"; + +test("303. Range Sum Query - Immutable", () => { + assert(new NumArray([-2, 0, 3, -5, 2, -1]).sumRange(0, 2) === 1); + assert(new NumArray([-2, 0, 3, -5, 2, -1]).sumRange(2, 5) === -1); + assert(new NumArray([-2, 0, 3, -5, 2, -1]).sumRange(0, 5) === -3); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(0, 8) === 4830 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(4, 5) === 6383 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(9, 11) === -15886 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(2, 11) === -5095 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(0, 12) === -15759 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(9, 12) === -20589 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(2, 5) === 11228 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(0, 9) === -1149 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(5, 9) === -9683 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(0, 1) === -5961 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(12, 12) === -4703 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(6, 7) === -6688 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(5, 8) === -3704 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(1, 1) === 2300 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(6, 7) === -6688 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(10, 11) === -9907 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(11, 12) === -9319 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(7, 8) === -1851 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(4, 11) === -9940 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(8, 9) === 272 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(4, 11) === -9940 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(2, 9) === 4812 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(2, 6) === 12642 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(11, 12) === -9319 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(5, 8) === -3704 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(11, 11) === -4616 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(1, 9) === 7112 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(12, 12) === -4703 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(10, 10) === -5291 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(4, 7) === -305 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(12, 12) === -4703 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(8, 10) === -5019 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(7, 9) === -7830 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(4, 7) === -305 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(0, 7) === -1421 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(8, 9) === 272 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(10, 12) === -14610 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(0, 9) === -1149 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(10, 12) === -14610 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(7, 12) === -22440 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(9, 9) === -5979 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(0, 12) === -15759 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(1, 3) === 7145 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(8, 8) === 6251 + ); + assert( + new NumArray([ + -8261, + 2300, + -1429, + 6274, + 9650, + -3267, + 1414, + -8102, + 6251, + -5979, + -5291, + -4616, + -4703 + ]).sumRange(7, 10) === -13121 + ); +}); diff --git a/solutions/removeDuplicatesFromSortedArray.test.ts b/solutions/removeDuplicatesFromSortedArray.test.ts deleted file mode 100644 index a37bb31..0000000 --- a/solutions/removeDuplicatesFromSortedArray.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import removeDuplicates from "./removeDuplicatesFromSortedArray"; - -describe("26. Remove Duplicates from Sorted Array", () => { - const TEST_CASES = new Map([ - [[1, 1, 2], [2, [1, 2]]], - [[0, 0, 1, 1, 1, 2, 2, 3, 3, 4], [5, [0, 1, 2, 3, 4]]], - [[], [0, []]] - ]); - - for (const [nums, [expected, expectedRemoved]] of TEST_CASES) { - it(`returns ${expected} (to be [${expectedRemoved}]) when called with [${nums}]`, () => { - const newLength = removeDuplicates(nums); - - expect(newLength).toBe(expected); - expect(nums.slice(0, newLength)).toEqual(expectedRemoved); - }); - } -}); diff --git a/solutions/removeDuplicatesFromSortedArray.ts b/solutions/remove_duplicates_from_sorted_array.ts similarity index 85% rename from solutions/removeDuplicatesFromSortedArray.ts rename to solutions/remove_duplicates_from_sorted_array.ts index ed19c2a..78af921 100644 --- a/solutions/removeDuplicatesFromSortedArray.ts +++ b/solutions/remove_duplicates_from_sorted_array.ts @@ -1,6 +1,6 @@ // 26. Remove Duplicates from Sorted Array // https://leetcode.com/problems/remove-duplicates-from-sorted-array/ -function removeDuplicates(nums: number[]): number { +export default function removeDuplicates(nums: number[]): number { // avoid because it will access [1] below if (nums.length === 0) return 0; @@ -18,5 +18,3 @@ function removeDuplicates(nums: number[]): number { // add 1 because i is cursor return noDuplicateI + 1; } - -export default removeDuplicates; diff --git a/solutions/remove_duplicates_from_sorted_array_test.ts b/solutions/remove_duplicates_from_sorted_array_test.ts new file mode 100644 index 0000000..c615f04 --- /dev/null +++ b/solutions/remove_duplicates_from_sorted_array_test.ts @@ -0,0 +1,9 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import removeDuplicates from "./remove_duplicates_from_sorted_array.ts"; + +test("26. Remove Duplicates from Sorted Array", () => { + assertEquals(removeDuplicates([1, 1, 2]), 2); + assertEquals(removeDuplicates([0, 0, 1, 1, 1, 2, 2, 3, 3, 4]), 5); + assertEquals(removeDuplicates([]), 0); +}); diff --git a/solutions/reorderLogFiles.test.ts b/solutions/reorderLogFiles.test.ts deleted file mode 100644 index 6ae03d1..0000000 --- a/solutions/reorderLogFiles.test.ts +++ /dev/null @@ -1,74 +0,0 @@ -import reorderLogFiles from "./reorderLogFiles"; - -describe("937. Reorder Log Files", () => { - const TEST_CASES = new Map([ - [ - ["a1 9 2 3 1", "g1 act car", "zo4 4 7", "ab1 off key dog", "a8 act zoo"], - ["g1 act car", "a8 act zoo", "ab1 off key dog", "a1 9 2 3 1", "zo4 4 7"] - ], - [ - [ - "a1 9 2 3 1", - "g1 act car", - "zo4 4 7", - "ab1 off key dog", - "a8 act zoo", - "a2 act car" - ], - [ - "a2 act car", - "g1 act car", - "a8 act zoo", - "ab1 off key dog", - "a1 9 2 3 1", - "zo4 4 7" - ] - ], - [ - ["j mo", "5 m w", "g 07", "o 2 0", "t q h"], - ["5 m w", "j mo", "t q h", "g 07", "o 2 0"] - ], - [ - [ - "6p tzwmh ige mc", - "ns 566543603829", - "ubd cujg j d yf", - "ha6 1 938 376 5", - "3yx 97 666 56 5", - "d 84 34353 2249", - "0 tllgmf qp znc", - "s 1088746413789", - "ys0 splqqxoflgx", - "uhb rfrwt qzx r", - "u lrvmdt ykmox", - "ah4 4209164350", - "rap 7729 8 125", - "4 nivgc qo z i", - "apx 814023338 8" - ], - [ - "ubd cujg j d yf", - "u lrvmdt ykmox", - "4 nivgc qo z i", - "uhb rfrwt qzx r", - "ys0 splqqxoflgx", - "0 tllgmf qp znc", - "6p tzwmh ige mc", - "ns 566543603829", - "ha6 1 938 376 5", - "3yx 97 666 56 5", - "d 84 34353 2249", - "s 1088746413789", - "ah4 4209164350", - "rap 7729 8 125", - "apx 814023338 8" - ] - ] - ]); - - for (const [logs, expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${logs}]`, () => { - expect(reorderLogFiles(logs)).toEqual(expected); - }); - } -}); diff --git a/solutions/reorderLogFiles.ts b/solutions/reorder_log_files.ts similarity index 93% rename from solutions/reorderLogFiles.ts rename to solutions/reorder_log_files.ts index 6e03661..27a13b6 100644 --- a/solutions/reorderLogFiles.ts +++ b/solutions/reorder_log_files.ts @@ -1,6 +1,6 @@ // 937. Reorder Log Files // https://leetcode.com/problems/reorder-log-files/ -function reorderLogFiles(logs: string[]): string[] { +export default function reorderLogFiles(logs: string[]): string[] { const digitLogs = []; const letterLogs = []; @@ -49,5 +49,3 @@ function reorderLogFiles(logs: string[]): string[] { // merge return [...letterLogs, ...digitLogs]; } - -export default reorderLogFiles; diff --git a/solutions/reorder_log_files_test.ts b/solutions/reorder_log_files_test.ts new file mode 100644 index 0000000..4c2322d --- /dev/null +++ b/solutions/reorder_log_files_test.ts @@ -0,0 +1,77 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import reorderLogFiles from "./reorder_log_files.ts"; + +test("937. Reorder Log Files", () => { + assertEquals( + reorderLogFiles([ + "a1 9 2 3 1", + "g1 act car", + "zo4 4 7", + "ab1 off key dog", + "a8 act zoo" + ]), + ["g1 act car", "a8 act zoo", "ab1 off key dog", "a1 9 2 3 1", "zo4 4 7"] + ); + assertEquals( + reorderLogFiles([ + "a1 9 2 3 1", + "g1 act car", + "zo4 4 7", + "ab1 off key dog", + "a8 act zoo", + "a2 act car" + ]), + [ + "a2 act car", + "g1 act car", + "a8 act zoo", + "ab1 off key dog", + "a1 9 2 3 1", + "zo4 4 7" + ] + ); + assertEquals(reorderLogFiles(["j mo", "5 m w", "g 07", "o 2 0", "t q h"]), [ + "5 m w", + "j mo", + "t q h", + "g 07", + "o 2 0" + ]); + assertEquals( + reorderLogFiles([ + "6p tzwmh ige mc", + "ns 566543603829", + "ubd cujg j d yf", + "ha6 1 938 376 5", + "3yx 97 666 56 5", + "d 84 34353 2249", + "0 tllgmf qp znc", + "s 1088746413789", + "ys0 splqqxoflgx", + "uhb rfrwt qzx r", + "u lrvmdt ykmox", + "ah4 4209164350", + "rap 7729 8 125", + "4 nivgc qo z i", + "apx 814023338 8" + ]), + [ + "ubd cujg j d yf", + "u lrvmdt ykmox", + "4 nivgc qo z i", + "uhb rfrwt qzx r", + "ys0 splqqxoflgx", + "0 tllgmf qp znc", + "6p tzwmh ige mc", + "ns 566543603829", + "ha6 1 938 376 5", + "3yx 97 666 56 5", + "d 84 34353 2249", + "s 1088746413789", + "ah4 4209164350", + "rap 7729 8 125", + "apx 814023338 8" + ] + ); +}); diff --git a/solutions/reverseInteger.test.ts b/solutions/reverseInteger.test.ts deleted file mode 100644 index 2c841d6..0000000 --- a/solutions/reverseInteger.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import reverse from "./reverseInteger"; - -describe("7. Reverse Integer", () => { - const TEST_CASES = new Map([ - [123, 321], - [-123, -321], - [-12, -21], - [120, 21], - [1563847412, 0] - ]); - - for (const [number, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${number}`, () => { - expect(reverse(number)).toBe(expected); - }); - } -}); diff --git a/solutions/reverseLinkedList.test.ts b/solutions/reverseLinkedList.test.ts deleted file mode 100644 index 9b89e11..0000000 --- a/solutions/reverseLinkedList.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { createSinglyLinkedListNode } from "../testUtilities/LinkedList"; -import reverseList from "./reverseLinkedList"; - -describe("206. Reverse Linked List", () => { - const TEST_CASES = new Map([ - [[0, 1], [1, 0]], - [[0, 1, 2, 3], [3, 2, 1, 0]], - [[0], [0]], - [[], []] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns [${expected}] when called with [${values}]`, () => { - expect(reverseList(createSinglyLinkedListNode(values))).toEqual( - createSinglyLinkedListNode(expected) - ); - }); - } -}); diff --git a/solutions/reverseString.test.ts b/solutions/reverseString.test.ts deleted file mode 100644 index 6cd5c4f..0000000 --- a/solutions/reverseString.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import reverseString from "./reverseString"; - -describe("344. Reverse String", () => { - const TEST_CASES = new Map([ - [["h", "e", "l", "l", "o"], ["o", "l", "l", "e", "h"]], - [["H", "a", "n", "n", "a", "h"], ["h", "a", "n", "n", "a", "H"]] - ]); - - for (const [chars, expected] of TEST_CASES) { - it(`reverses [${chars}] to be [${expected}]`, () => { - const characters = [...chars]; - - reverseString(characters); - - expect(characters).toEqual(expected); - }); - } -}); diff --git a/solutions/reverseInteger.ts b/solutions/reverse_integer.ts similarity index 89% rename from solutions/reverseInteger.ts rename to solutions/reverse_integer.ts index ecddbb9..2278bb4 100644 --- a/solutions/reverseInteger.ts +++ b/solutions/reverse_integer.ts @@ -1,6 +1,6 @@ // 7. Reverse Integer // https://leetcode.com/problems/reverse-integer/ -function reverse(x: number): number { +export default function reverse(x: number): number { let currentX = x; let reversedX = 0; @@ -17,5 +17,3 @@ function reverse(x: number): number { ? reversedX : 0; } - -export default reverse; diff --git a/solutions/reverse_integer_test.ts b/solutions/reverse_integer_test.ts new file mode 100644 index 0000000..c98cb97 --- /dev/null +++ b/solutions/reverse_integer_test.ts @@ -0,0 +1,11 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import reverse from "./reverse_integer.ts"; + +test("7. Reverse Integer", () => { + assert(reverse(123) === 321); + assert(reverse(-123) === -321); + assert(reverse(-12) === -21); + assert(reverse(120) === 21); + assert(reverse(1563847412) === 0); +}); diff --git a/solutions/reverseLinkedList.ts b/solutions/reverse_linked_list.ts similarity index 79% rename from solutions/reverseLinkedList.ts rename to solutions/reverse_linked_list.ts index 15335b9..5ebbdbd 100644 --- a/solutions/reverseLinkedList.ts +++ b/solutions/reverse_linked_list.ts @@ -1,8 +1,8 @@ -import { SinglyLinkedListNode } from "../types/LinkedList"; +import { SinglyLinkedListNode } from "../types/linked_list.ts"; // 206. Reverse Linked List // https://leetcode.com/problems/reverse-linked-list/ -function reverseList( +export default function reverseList( head: SinglyLinkedListNode | null ): SinglyLinkedListNode | null { if (head === null || head.next === null) return head; @@ -16,5 +16,3 @@ function reverseList( return newHead; } - -export default reverseList; diff --git a/solutions/reverse_linked_list_test.ts b/solutions/reverse_linked_list_test.ts new file mode 100644 index 0000000..9826aef --- /dev/null +++ b/solutions/reverse_linked_list_test.ts @@ -0,0 +1,23 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { createSinglyLinkedListNode } from "../test_utilities/linked_list.ts"; +import reverseList from "./reverse_linked_list.ts"; + +test("206. Reverse Linked List", () => { + assertEquals( + reverseList(createSinglyLinkedListNode([0, 1])), + createSinglyLinkedListNode([1, 0]) + ); + assertEquals( + reverseList(createSinglyLinkedListNode([0, 1, 2, 3])), + createSinglyLinkedListNode([3, 2, 1, 0]) + ); + assertEquals( + reverseList(createSinglyLinkedListNode([0])), + createSinglyLinkedListNode([0]) + ); + assertEquals( + reverseList(createSinglyLinkedListNode([])), + createSinglyLinkedListNode([]) + ); +}); diff --git a/solutions/reverseString.ts b/solutions/reverse_string.ts similarity index 77% rename from solutions/reverseString.ts rename to solutions/reverse_string.ts index 252ab28..b496cba 100644 --- a/solutions/reverseString.ts +++ b/solutions/reverse_string.ts @@ -1,6 +1,6 @@ // 344. Reverse String // https://leetcode.com/problems/reverse-string/ -function reverseString(chars: string[]): void { +export default function reverseString(chars: string[]): void { // i: 0, 1, 2..., r: 4, 3, 2... // r >= i is the middle of chars for (let i = 0, r = chars.length - 1; i < r; ++i, --r) { @@ -8,5 +8,3 @@ function reverseString(chars: string[]): void { [chars[i], chars[r]] = [chars[r], chars[i]]; } } - -export default reverseString; diff --git a/solutions/reverse_string_test.ts b/solutions/reverse_string_test.ts new file mode 100644 index 0000000..2658b79 --- /dev/null +++ b/solutions/reverse_string_test.ts @@ -0,0 +1,17 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import reverseString from "./reverse_string.ts"; + +test("344. Reverse String", () => { + const chars1 = ["h", "e", "l", "l", "o"]; + + reverseString(chars1); + + assertEquals(chars1, ["o", "l", "l", "e", "h"]); + + const chars2 = ["H", "a", "n", "n", "a", "h"]; + + reverseString(chars2); + + assertEquals(chars2, ["h", "a", "n", "n", "a", "H"]); +}); diff --git a/solutions/romanToInteger.test.ts b/solutions/romanToInteger.test.ts deleted file mode 100644 index 536f124..0000000 --- a/solutions/romanToInteger.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import romanToInt from "./romanToInteger"; - -describe("13. Roman to Integer", () => { - const TEST_CASES = new Map([ - ["VI", 6], - ["IV", 4], - ["III", 3], - ["IIII", 4], - ["XIII", 13], - ["MDCLXVI", 1666], - ["MCDCXLXIV", 1554], - ["CMCDXCXLIXIV", 1443] - ]); - - for (const [s, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${s}`, () => { - expect(romanToInt(s)).toBe(expected); - }); - } -}); diff --git a/solutions/romanToInteger.ts b/solutions/roman_to_integer.ts similarity index 91% rename from solutions/romanToInteger.ts rename to solutions/roman_to_integer.ts index 3e64d26..2a3ecc7 100644 --- a/solutions/romanToInteger.ts +++ b/solutions/roman_to_integer.ts @@ -1,6 +1,6 @@ // 13. Roman to Integer // https://leetcode.com/problems/roman-to-integer/ -function romanToInt(s: string): number { +export default function romanToInt(s: string): number { let total = 0; for (let i = 0; i < s.length; ++i) { @@ -36,5 +36,3 @@ const ROMAN_CHAR_INT_MAP = new Map([ ["D", 500], ["M", 1000] ]); - -export default romanToInt; diff --git a/solutions/roman_to_integer_test.ts b/solutions/roman_to_integer_test.ts new file mode 100644 index 0000000..b341966 --- /dev/null +++ b/solutions/roman_to_integer_test.ts @@ -0,0 +1,14 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import romanToInt from "./roman_to_integer.ts"; + +test("13. Roman to Integer", () => { + assert(romanToInt("VI") === 6); + assert(romanToInt("IV") === 4); + assert(romanToInt("III") === 3); + assert(romanToInt("IIII") === 4); + assert(romanToInt("XIII") === 13); + assert(romanToInt("MDCLXVI") === 1666); + assert(romanToInt("MCDCXLXIV") === 1554); + assert(romanToInt("CMCDXCXLIXIV") === 1443); +}); diff --git a/solutions/searchA2dMatrix2.test.ts b/solutions/searchA2dMatrix2.test.ts deleted file mode 100644 index 4f9ac9a..0000000 --- a/solutions/searchA2dMatrix2.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import searchMatrix from "./searchA2dMatrix2"; - -describe("240. Search a 2D Matrix II", () => { - const TEST_CASES = new Map<[number[][], number], boolean>([ - [ - [ - [ - [1, 4, 7, 11, 15], - [2, 5, 8, 12, 19], - [3, 6, 9, 16, 22], - [10, 13, 14, 17, 24], - [18, 21, 23, 26, 30] - ], - 5 - ], - true - ], - [ - [ - [ - [1, 4, 7, 11, 15], - [2, 5, 8, 12, 19], - [3, 6, 9, 16, 22], - [10, 13, 14, 17, 24], - [18, 21, 23, 26, 30] - ], - 20 - ], - false - ] - ]); - - for (const [[matrix, target], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${matrix.map( - list => `[${list}]` - )}] and ${target}`, () => { - expect(searchMatrix(matrix, target)).toBe(expected); - }); - } -}); diff --git a/solutions/searchInRotatedSortedArray.test.ts b/solutions/searchInRotatedSortedArray.test.ts deleted file mode 100644 index a8fd1d7..0000000 --- a/solutions/searchInRotatedSortedArray.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import search from "./searchInRotatedSortedArray"; - -describe("33. Search in Rotated Sorted Array", () => { - const TEST_CASES = new Map<[number[], number], number>([ - [[[4, 5, 6, 7, 0, 1, 2], 0], 4], - [[[4, 5, 6, 7, 0, 1, 2], 3], -1], - [[[4, 5, 6, 7, 0, 1, 2], 4], 0], - [[[3, 1], 3], 0], - [[[7, 8, 1, 2, 3, 4, 5, 6], 2], 3] - ]); - - for (const [[nums, target], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${nums}] and ${target}`, () => { - expect(search(nums, target)).toBe(expected); - }); - } -}); diff --git a/solutions/searchInsertPosition.test.ts b/solutions/searchInsertPosition.test.ts deleted file mode 100644 index 8e76027..0000000 --- a/solutions/searchInsertPosition.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import searchInsert from "./searchInsertPosition"; - -describe("35. Search Insert Position", () => { - const TEST_CASES = new Map<[number[], number], number>([ - [[[1, 3, 5, 6], 5], 2], - [[[1, 3, 5, 6], 2], 1], - [[[1, 3, 5, 6], 7], 4], - [[[1, 3, 5, 6], 0], 0] - ]); - - for (const [[nums, target], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${nums}] and ${target}`, () => { - expect(searchInsert(nums, target)).toBe(expected); - }); - } -}); diff --git a/solutions/searchA2dMatrix2.ts b/solutions/search_a2d_matrix2.ts similarity index 100% rename from solutions/searchA2dMatrix2.ts rename to solutions/search_a2d_matrix2.ts diff --git a/solutions/search_a2d_matrix2_test.ts b/solutions/search_a2d_matrix2_test.ts new file mode 100644 index 0000000..3523e13 --- /dev/null +++ b/solutions/search_a2d_matrix2_test.ts @@ -0,0 +1,30 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import searchMatrix from "./search_a2d_matrix2.ts"; + +test("240. Search a 2D Matrix II", () => { + assert( + searchMatrix( + [ + [1, 4, 7, 11, 15], + [2, 5, 8, 12, 19], + [3, 6, 9, 16, 22], + [10, 13, 14, 17, 24], + [18, 21, 23, 26, 30] + ], + 5 + ) === true + ); + assert( + searchMatrix( + [ + [1, 4, 7, 11, 15], + [2, 5, 8, 12, 19], + [3, 6, 9, 16, 22], + [10, 13, 14, 17, 24], + [18, 21, 23, 26, 30] + ], + 20 + ) === false + ); +}); diff --git a/solutions/searchInRotatedSortedArray.ts b/solutions/search_in_rotated_sorted_array.ts similarity index 100% rename from solutions/searchInRotatedSortedArray.ts rename to solutions/search_in_rotated_sorted_array.ts diff --git a/solutions/search_in_rotated_sorted_array_test.ts b/solutions/search_in_rotated_sorted_array_test.ts new file mode 100644 index 0000000..d29b9db --- /dev/null +++ b/solutions/search_in_rotated_sorted_array_test.ts @@ -0,0 +1,11 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import search from "./search_in_rotated_sorted_array.ts"; + +test("33. Search in Rotated Sorted Array", () => { + assert(search([4, 5, 6, 7, 0, 1, 2], 0) === 4); + assert(search([4, 5, 6, 7, 0, 1, 2], 3) === -1); + assert(search([4, 5, 6, 7, 0, 1, 2], 4) === 0); + assert(search([3, 1], 3) === 0); + assert(search([7, 8, 1, 2, 3, 4, 5, 6], 2) === 3); +}); diff --git a/solutions/searchInsertPosition.ts b/solutions/search_insert_position.ts similarity index 100% rename from solutions/searchInsertPosition.ts rename to solutions/search_insert_position.ts diff --git a/solutions/search_insert_position_test.ts b/solutions/search_insert_position_test.ts new file mode 100644 index 0000000..044651f --- /dev/null +++ b/solutions/search_insert_position_test.ts @@ -0,0 +1,10 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import searchInsert from "./search_insert_position.ts"; + +test("35. Search Insert Position", () => { + assert(searchInsert([1, 3, 5, 6], 5) === 2); + assert(searchInsert([1, 3, 5, 6], 2) === 1); + assert(searchInsert([1, 3, 5, 6], 7) === 4); + assert(searchInsert([1, 3, 5, 6], 0) === 0); +}); diff --git a/solutions/sqrtx.test.ts b/solutions/sqrtx.test.ts deleted file mode 100644 index e503133..0000000 --- a/solutions/sqrtx.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import mySqrt from "./sqrtx"; - -describe("69. Sqrt(x)", () => { - const TEST_CASES = new Map([ - [16, 4], - [17, 4], - [15, 3], - [8, 2], - [1, 1], - [0, 0], - [Number.MAX_SAFE_INTEGER, 94906265] - ]); - - for (const [x, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${x}`, () => { - expect(mySqrt(x)).toBe(expected); - }); - } -}); diff --git a/solutions/sqrtx_test.ts b/solutions/sqrtx_test.ts new file mode 100644 index 0000000..ec9fb59 --- /dev/null +++ b/solutions/sqrtx_test.ts @@ -0,0 +1,13 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import mySqrt from "./sqrtx.ts"; + +test("69. Sqrt(x)", () => { + assert(mySqrt(16) === 4); + assert(mySqrt(17) === 4); + assert(mySqrt(15) === 3); + assert(mySqrt(8) === 2); + assert(mySqrt(1) === 1); + assert(mySqrt(0) === 0); + assert(mySqrt(Number.MAX_SAFE_INTEGER) === 94906265); +}); diff --git a/solutions/strobogrammaticNumber.test.ts b/solutions/strobogrammaticNumber.test.ts deleted file mode 100644 index ee1297f..0000000 --- a/solutions/strobogrammaticNumber.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import isStrobogrammatic from "./strobogrammaticNumber"; - -describe("246. Strobogrammatic Number", () => { - const TEST_CASES = new Map([ - ["69", true], - ["818", true], - ["962", false], - ["1818", false], - ["0", true], - ["6", false], - ["", true] - ]); - - for (const [num, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${num}`, () => { - expect(isStrobogrammatic(num)).toBe(expected); - }); - } -}); diff --git a/solutions/strobogrammaticNumber.ts b/solutions/strobogrammatic_number.ts similarity index 83% rename from solutions/strobogrammaticNumber.ts rename to solutions/strobogrammatic_number.ts index 6550d8c..2b5e8ba 100644 --- a/solutions/strobogrammaticNumber.ts +++ b/solutions/strobogrammatic_number.ts @@ -1,6 +1,6 @@ // 246. Strobogrammatic Number // https://leetcode.com/problems/strobogrammatic-number/ -function isStrobogrammatic(num: string): boolean { +export default function isStrobogrammatic(num: string): boolean { // pick one by one from both of the head and tail for (let i = 0, j = num.length - 1; i < num.length / 2; ++i, --j) { const [ni, nj] = [num[i], num[j]]; @@ -13,5 +13,3 @@ function isStrobogrammatic(num: string): boolean { return true; } - -export default isStrobogrammatic; diff --git a/solutions/strobogrammatic_number_test.ts b/solutions/strobogrammatic_number_test.ts new file mode 100644 index 0000000..b0d4f83 --- /dev/null +++ b/solutions/strobogrammatic_number_test.ts @@ -0,0 +1,13 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import isStrobogrammatic from "./strobogrammatic_number.ts"; + +test("246. Strobogrammatic Number", () => { + assert(isStrobogrammatic("69") === true); + assert(isStrobogrammatic("818") === true); + assert(isStrobogrammatic("962") === false); + assert(isStrobogrammatic("1818") === false); + assert(isStrobogrammatic("0") === true); + assert(isStrobogrammatic("6") === false); + assert(isStrobogrammatic("") === true); +}); diff --git a/solutions/subsets.test.ts b/solutions/subsets.test.ts deleted file mode 100644 index 634f0aa..0000000 --- a/solutions/subsets.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import subsets from "./subsets"; - -describe("78. Subsets", () => { - const TEST_CASES = new Map([ - [[1, 2, 3], [[3], [1], [2], [1, 2, 3], [1, 3], [2, 3], [1, 2], []]] - ]); - - for (const [nums, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${nums}`, () => { - const result = subsets(nums); - - expect([...result].sort()).toEqual([...expected].sort()); - }); - } -}); diff --git a/solutions/subsets.ts b/solutions/subsets.ts index e84aadf..2142d1c 100644 --- a/solutions/subsets.ts +++ b/solutions/subsets.ts @@ -1,6 +1,6 @@ // 78. Subsets // https://leetcode.com/problems/subsets/ -function subsets(nums: number[]): number[][] { +export default function subsets(nums: number[]): number[][] { const result = []; for (let i = 0; i < Math.pow(2, nums.length); ++i) { @@ -18,5 +18,3 @@ function subsets(nums: number[]): number[][] { return result; } - -export default subsets; diff --git a/solutions/subsets_test.ts b/solutions/subsets_test.ts new file mode 100644 index 0000000..98e22cc --- /dev/null +++ b/solutions/subsets_test.ts @@ -0,0 +1,10 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import subsets from "./subsets.ts"; + +test("78. Subsets", () => { + assertEquals( + subsets([1, 2, 3]).sort(), + [[3], [1], [2], [1, 2, 3], [1, 3], [2, 3], [1, 2], []].sort() + ); +}); diff --git a/solutions/subtreeOfAnotherTree.test.ts b/solutions/subtreeOfAnotherTree.test.ts deleted file mode 100644 index 7dc4630..0000000 --- a/solutions/subtreeOfAnotherTree.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import isSubtree from "./subtreeOfAnotherTree"; - -describe("572. Subtree of Another Tree", () => { - const TEST_CASES = new Map<[(number | null)[], (number | null)[]], boolean>([ - [[[4, 4, 5, 1, 2], [4, 1, 2]], true], - [[[4, 4, 5, 1, 2, null, null, null, null, 0], [4, 1, 2]], false], - [ - [ - [ - 1, - null, - 1, - null, - 1, - null, - 1, - null, - 1, - null, - 1, - null, - 1, - null, - 1, - null, - 1, - null, - 1, - null, - 1, - 2 - ], - [1, null, 1, null, 1, null, 1, null, 1, null, 1, 2] - ], - true - ] - ]); - - for (const [[s, t], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${s}] and [${t}]`, () => { - expect( - isSubtree(createBinaryTreeNode(s)!, createBinaryTreeNode(t)!) - ).toBe(expected); - }); - } -}); diff --git a/solutions/subtreeOfAnotherTree.ts b/solutions/subtree_of_another_tree.ts similarity index 91% rename from solutions/subtreeOfAnotherTree.ts rename to solutions/subtree_of_another_tree.ts index 982e2bf..61ca5e3 100644 --- a/solutions/subtreeOfAnotherTree.ts +++ b/solutions/subtree_of_another_tree.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 572. Subtree of Another Tree // https://leetcode.com/problems/subtree-of-another-tree/ diff --git a/solutions/subtree_of_another_tree_test.ts b/solutions/subtree_of_another_tree_test.ts new file mode 100644 index 0000000..043856c --- /dev/null +++ b/solutions/subtree_of_another_tree_test.ts @@ -0,0 +1,48 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import isSubtree from "./subtree_of_another_tree.ts"; + +test("572. Subtree of Another Tree", () => { + assert( + isSubtree( + createBinaryTreeNode([4, 4, 5, 1, 2]), + createBinaryTreeNode([4, 1, 2]) + ) === true + ); + assert( + isSubtree( + createBinaryTreeNode([4, 4, 5, 1, 2, null, null, null, null, 0]), + createBinaryTreeNode([4, 1, 2]) + ) === false + ); + assert( + isSubtree( + createBinaryTreeNode([ + 1, + null, + 1, + null, + 1, + null, + 1, + null, + 1, + null, + 1, + null, + 1, + null, + 1, + null, + 1, + null, + 1, + null, + 1, + 2 + ]), + createBinaryTreeNode([1, null, 1, null, 1, null, 1, null, 1, null, 1, 2]) + ) === true + ); +}); diff --git a/solutions/symmetricTree.test.ts b/solutions/symmetricTree.test.ts deleted file mode 100644 index 9f17f6d..0000000 --- a/solutions/symmetricTree.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import isSymmetric from "./symmetricTree"; - -describe("101. Symmetric Tree", () => { - const TEST_CASES = new Map([ - [[1, 2, 2, 3, 4, 4, 3], true], - [[1, 2, 2, 3, null, 3, null], false], - [[1, 2, 2, 3, null, null, 3], true], - [[], true] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(isSymmetric(createBinaryTreeNode(values))).toBe(expected); - }); - } -}); diff --git a/solutions/symmetricTree.ts b/solutions/symmetric_tree.ts similarity index 82% rename from solutions/symmetricTree.ts rename to solutions/symmetric_tree.ts index 387e832..0ca372e 100644 --- a/solutions/symmetricTree.ts +++ b/solutions/symmetric_tree.ts @@ -1,8 +1,10 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 101. Symmetric Tree // https://leetcode.com/problems/symmetric-tree/ -function isSymmetric(node: BinaryTreeNode | null): boolean { +export default function isSymmetric( + node: BinaryTreeNode | null +): boolean { // check recursively for each outside-elements function isEqual( node1: BinaryTreeNode | null, @@ -30,5 +32,3 @@ function isSymmetric(node: BinaryTreeNode | null): boolean { return isEqual(node.left, node.right); } - -export default isSymmetric; diff --git a/solutions/symmetric_tree_test.ts b/solutions/symmetric_tree_test.ts new file mode 100644 index 0000000..f0f49f3 --- /dev/null +++ b/solutions/symmetric_tree_test.ts @@ -0,0 +1,15 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import isSymmetric from "./symmetric_tree.ts"; + +test("101. Symmetric Tree", () => { + assert(isSymmetric(createBinaryTreeNode([1, 2, 2, 3, 4, 4, 3])) === true); + assert( + isSymmetric(createBinaryTreeNode([1, 2, 2, 3, null, 3, null])) === false + ); + assert( + isSymmetric(createBinaryTreeNode([1, 2, 2, 3, null, null, 3])) === true + ); + assert(isSymmetric(createBinaryTreeNode([])) === true); +}); diff --git a/solutions/twoSum.test.ts b/solutions/twoSum.test.ts deleted file mode 100644 index 6245aad..0000000 --- a/solutions/twoSum.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import twoSum from "./twoSum"; - -describe("1. Two Sum", () => { - const TEST_CASES = new Map<[number[], number], [number, number]>([ - [[[2, 7, 11, 15], 9], [0, 1]], - [[[2, 7, 11, 15], 18], [1, 2]] - ]); - - for (const [[nums, target], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${nums}] and ${target}`, () => { - expect(twoSum(nums, target)).toEqual(expected); - }); - } -}); diff --git a/solutions/twoSum.ts b/solutions/two_sum.ts similarity index 85% rename from solutions/twoSum.ts rename to solutions/two_sum.ts index a6be400..9d60286 100644 --- a/solutions/twoSum.ts +++ b/solutions/two_sum.ts @@ -1,6 +1,9 @@ // 1. Two Sum // https://leetcode.com/problems/two-sum/ -function twoSum(nums: number[], target: number): [number, number] { +export default function twoSum( + nums: number[], + target: number +): [number, number] { // Map const map = new Map(); @@ -19,5 +22,3 @@ function twoSum(nums: number[], target: number): [number, number] { throw new Error("there's no answer."); } - -export default twoSum; diff --git a/solutions/two_sum_test.ts b/solutions/two_sum_test.ts new file mode 100644 index 0000000..e2d73dd --- /dev/null +++ b/solutions/two_sum_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import twoSum from "./two_sum.ts"; + +test("1. Two Sum", () => { + assertEquals(twoSum([2, 7, 11, 15], 9), [0, 1]); + assertEquals(twoSum([2, 7, 11, 15], 18), [1, 2]); +}); diff --git a/solutions/uniqueEmailAddresses.test.ts b/solutions/uniqueEmailAddresses.test.ts deleted file mode 100644 index 4944005..0000000 --- a/solutions/uniqueEmailAddresses.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import numUniqueEmails from "./uniqueEmailAddresses"; - -describe("929. Unique Email Addresses", () => { - const TEST_CASES = new Map([ - [ - [ - "test.email+alex@leetcode.com", - "test.e.mail+bob.cathy@leetcode.com", - "testemail+david@lee.tcode.com" - ], - 2 - ], - [ - [ - "testemail@leetcode.com", - "testemail1@leetcode.com", - "testemail+david@lee.tcode.com" - ], - 3 - ] - ]); - - for (const [emails, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${emails}]`, () => { - expect(numUniqueEmails(emails)).toBe(expected); - }); - } -}); diff --git a/solutions/uniquePaths.test.ts b/solutions/uniquePaths.test.ts deleted file mode 100644 index 6cb0a24..0000000 --- a/solutions/uniquePaths.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import uniquePaths from "./uniquePaths"; - -describe("62. Unique Paths", () => { - const TEST_CASES = new Map([[[3, 2], 3], [[7, 3], 28]]); - - for (const [[m, n], expected] of TEST_CASES) { - it(`returns ${expected} when called with ${m} and ${n}`, () => { - expect(uniquePaths(m, n)).toBe(expected); - }); - } -}); diff --git a/solutions/uniqueEmailAddresses.ts b/solutions/unique_email_addresses.ts similarity index 77% rename from solutions/uniqueEmailAddresses.ts rename to solutions/unique_email_addresses.ts index de8b2de..db47cb1 100644 --- a/solutions/uniqueEmailAddresses.ts +++ b/solutions/unique_email_addresses.ts @@ -1,6 +1,6 @@ // 929. Unique Email Addresses // https://leetcode.com/problems/unique-email-addresses/ -function numUniqueEmails(emails: string[]): number { +export default function numUniqueEmails(emails: string[]): number { const unique = new Set(); for (const email of emails) { @@ -10,5 +10,3 @@ function numUniqueEmails(emails: string[]): number { return unique.size; } - -export default numUniqueEmails; diff --git a/solutions/unique_email_addresses_test.ts b/solutions/unique_email_addresses_test.ts new file mode 100644 index 0000000..4c593d7 --- /dev/null +++ b/solutions/unique_email_addresses_test.ts @@ -0,0 +1,20 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import numUniqueEmails from "./unique_email_addresses.ts"; + +test("929. Unique Email Addresses", () => { + assert( + numUniqueEmails([ + "test.email+alex@leetcode.com", + "test.e.mail+bob.cathy@leetcode.com", + "testemail+david@lee.tcode.com" + ]) === 2 + ); + assert( + numUniqueEmails([ + "testemail@leetcode.com", + "testemail1@leetcode.com", + "testemail+david@lee.tcode.com" + ]) === 3 + ); +}); diff --git a/solutions/uniquePaths.ts b/solutions/unique_paths.ts similarity index 100% rename from solutions/uniquePaths.ts rename to solutions/unique_paths.ts diff --git a/solutions/unique_paths_test.ts b/solutions/unique_paths_test.ts new file mode 100644 index 0000000..b43b90a --- /dev/null +++ b/solutions/unique_paths_test.ts @@ -0,0 +1,8 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import uniquePaths from "./unique_paths.ts"; + +test("62. Unique Paths", () => { + assert(uniquePaths(3, 2) === 3); + assert(uniquePaths(7, 3) === 28); +}); diff --git a/solutions/validAnagram.test.ts b/solutions/validAnagram.test.ts deleted file mode 100644 index a39be7f..0000000 --- a/solutions/validAnagram.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import isAnagram from "./validAnagram"; - -describe("242. Valid Anagram", () => { - const TEST_CASES = new Map([ - [["anagram", "nagaram"], true], - [["car", "rat"], false], - [["a", "aa"], false] - ]); - - for (const [[s, t], expected] of TEST_CASES) { - it(`returns ${expected} when called with ${s} and ${t}`, () => { - expect(isAnagram(s, t)).toBe(expected); - }); - } -}); diff --git a/solutions/validPalindrome.test.ts b/solutions/validPalindrome.test.ts deleted file mode 100644 index ee790df..0000000 --- a/solutions/validPalindrome.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -import isPalindrome from "./validPalindrome"; - -describe("125. Valid Palindrome", () => { - const TEST_CASES = new Map([ - ["A man, a plan, a canal: Panama", true], - ["race a car", false], - ["", true], - ["0P", false] - ]); - - for (const [s, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${s}`, () => { - expect(isPalindrome(s)).toBe(expected); - }); - } -}); diff --git a/solutions/validParentheses.test.ts b/solutions/validParentheses.test.ts deleted file mode 100644 index 0e97cb6..0000000 --- a/solutions/validParentheses.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import isValid from "./validParentheses"; - -describe("20. Valid Parentheses", () => { - const TEST_CASES = new Map([ - ["()", true], - ["()[]{}", true], - ["(]", false], - ["([)]", false], - ["{[]}", true], - ["[", false], - ["[{", false] - ]); - - for (const [s, expected] of TEST_CASES) { - it(`returns ${expected} when called with ${s}`, () => { - expect(isValid(s)).toBe(expected); - }); - } -}); diff --git a/solutions/validAnagram.ts b/solutions/valid_anagram.ts similarity index 100% rename from solutions/validAnagram.ts rename to solutions/valid_anagram.ts diff --git a/solutions/valid_anagram_test.ts b/solutions/valid_anagram_test.ts new file mode 100644 index 0000000..e9b54ea --- /dev/null +++ b/solutions/valid_anagram_test.ts @@ -0,0 +1,9 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import isAnagram from "./valid_anagram.ts"; + +test("242. Valid Anagram", () => { + assert(isAnagram("anagram", "nagaram") === true); + assert(isAnagram("car", "rat") === false); + assert(isAnagram("a", "aa") === false); +}); diff --git a/solutions/validPalindrome.ts b/solutions/valid_palindrome.ts similarity index 90% rename from solutions/validPalindrome.ts rename to solutions/valid_palindrome.ts index fd900b0..6cd2739 100644 --- a/solutions/validPalindrome.ts +++ b/solutions/valid_palindrome.ts @@ -1,6 +1,6 @@ // 125. Valid Palindrome // https://leetcode.com/problems/valid-palindrome/ -function isPalindrome(s: string): boolean { +export default function isPalindrome(s: string): boolean { const sanitized = []; for (let i = 0; i < s.length; ++i) { @@ -32,5 +32,3 @@ function isPalindrome(s: string): boolean { return true; } - -export default isPalindrome; diff --git a/solutions/valid_palindrome_test.ts b/solutions/valid_palindrome_test.ts new file mode 100644 index 0000000..f509345 --- /dev/null +++ b/solutions/valid_palindrome_test.ts @@ -0,0 +1,10 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import isPalindrome from "./valid_palindrome.ts"; + +test("125. Valid Palindrome", () => { + assert(isPalindrome("A man, a plan, a canal: Panama") === true); + assert(isPalindrome("race a car") === false); + assert(isPalindrome("") === true); + assert(isPalindrome("0P") === false); +}); diff --git a/solutions/validParentheses.ts b/solutions/valid_parentheses.ts similarity index 91% rename from solutions/validParentheses.ts rename to solutions/valid_parentheses.ts index 0bb5ed0..16ad426 100644 --- a/solutions/validParentheses.ts +++ b/solutions/valid_parentheses.ts @@ -1,6 +1,6 @@ // 20. Valid Parentheses // https://leetcode.com/problems/valid-parentheses/ -function isValid(s: string): boolean { +export default function isValid(s: string): boolean { let stack: string[] = []; for (let i = 0; i < s.length; ++i) { @@ -23,5 +23,3 @@ function isValid(s: string): boolean { // FYI: it doesn't so much faster even if you change these into char code (number) const OPEN_BRACKET_SET = new Set(["(", "[", "{"]); const BRACKET_PAIR_MAP = new Map([[")", "("], ["]", "["], ["}", "{"]]); - -export default isValid; diff --git a/solutions/valid_parentheses_test.ts b/solutions/valid_parentheses_test.ts new file mode 100644 index 0000000..a87561e --- /dev/null +++ b/solutions/valid_parentheses_test.ts @@ -0,0 +1,13 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import isValid from "./valid_parentheses.ts"; + +test("20. Valid Parentheses", () => { + assert(isValid("()") === true); + assert(isValid("()[]{}") === true); + assert(isValid("(]") === false); + assert(isValid("([)]") === false); + assert(isValid("{[]}") === true); + assert(isValid("[") === false); + assert(isValid("[{") === false); +}); diff --git a/solutions/validateBinarySearchTree.test.ts b/solutions/validateBinarySearchTree.test.ts deleted file mode 100644 index a6f127e..0000000 --- a/solutions/validateBinarySearchTree.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createBinaryTreeNode } from "../testUtilities/BinaryTree"; -import isValidBST from "./validateBinarySearchTree"; - -describe("98. Validate Binary Search Tree", () => { - const TEST_CASES = new Map([ - [[2, 1, 3], true], - [[5, 1, 4, null, null, 3, 6], false], - [[1, 1], false], - [[], true] - ]); - - for (const [values, expected] of TEST_CASES) { - it(`returns ${expected} when called with [${values}]`, () => { - expect(isValidBST(createBinaryTreeNode(values))).toBe(expected); - }); - } -}); diff --git a/solutions/validateBinarySearchTree.ts b/solutions/validate_binary_search_tree.ts similarity index 88% rename from solutions/validateBinarySearchTree.ts rename to solutions/validate_binary_search_tree.ts index d50d8e1..35fd9e5 100644 --- a/solutions/validateBinarySearchTree.ts +++ b/solutions/validate_binary_search_tree.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; // 98. Validate Binary Search Tree // https://leetcode.com/problems/validate-binary-search-tree/ diff --git a/solutions/validate_binary_search_tree_test.ts b/solutions/validate_binary_search_tree_test.ts new file mode 100644 index 0000000..857a103 --- /dev/null +++ b/solutions/validate_binary_search_tree_test.ts @@ -0,0 +1,13 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "../test_utilities/binary_tree.ts"; +import isValidBST from "./validate_binary_search_tree.ts"; + +test("98. Validate Binary Search Tree", () => { + assert(isValidBST(createBinaryTreeNode([2, 1, 3])) === true); + assert( + isValidBST(createBinaryTreeNode([5, 1, 4, null, null, 3, 6])) === false + ); + assert(isValidBST(createBinaryTreeNode([1, 1])) === false); + assert(isValidBST(createBinaryTreeNode([])) === true); +}); diff --git a/solutions/verifyingAnAlienDictionary.test.ts b/solutions/verifyingAnAlienDictionary.test.ts deleted file mode 100644 index dbbdf29..0000000 --- a/solutions/verifyingAnAlienDictionary.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import isAlienSorted from "./verifyingAnAlienDictionary"; - -describe("953. Verifying an Alien Dictionary", () => { - const TEST_CASES = new Map<[string[], string], boolean>([ - [[["hello", "leetcode"], "hlabcdefgijkmnopqrstuvwxyz"], true], - [[["word", "world", "row"], "worldabcefghijkmnpqstuvxyz"], false], - [[["apple", "app"], "abcdefghijklmnopqrstuvwxyz"], false] - ]); - - for (const [[words, order], expected] of TEST_CASES) { - it(`returns ${expected} when called with [${words}] and ${order}`, () => { - expect(isAlienSorted(words, order)).toBe(expected); - }); - } -}); diff --git a/solutions/verifyingAnAlienDictionary.ts b/solutions/verifying_an_alien_dictionary.ts similarity index 91% rename from solutions/verifyingAnAlienDictionary.ts rename to solutions/verifying_an_alien_dictionary.ts index 7ebd2c0..d6d8c3c 100644 --- a/solutions/verifyingAnAlienDictionary.ts +++ b/solutions/verifying_an_alien_dictionary.ts @@ -1,6 +1,6 @@ // 953. Verifying an Alien Dictionary // https://leetcode.com/problems/verifying-an-alien-dictionary/ -function isAlienSorted(words: string[], order: string): boolean { +export default function isAlienSorted(words: string[], order: string): boolean { // make shallow copy to delete checked words below let _words = [...words]; let i = 0; @@ -35,5 +35,3 @@ function isAlienSorted(words: string[], order: string): boolean { return true; } - -export default isAlienSorted; diff --git a/solutions/verifying_an_alien_dictionary_test.ts b/solutions/verifying_an_alien_dictionary_test.ts new file mode 100644 index 0000000..f80dbab --- /dev/null +++ b/solutions/verifying_an_alien_dictionary_test.ts @@ -0,0 +1,16 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert } from "https://deno.land/std/testing/asserts.ts"; +import isAlienSorted from "./verifying_an_alien_dictionary.ts"; + +test("953. Verifying an Alien Dictionary", () => { + assert( + isAlienSorted(["hello", "leetcode"], "hlabcdefgijkmnopqrstuvwxyz") === true + ); + assert( + isAlienSorted(["word", "world", "row"], "worldabcefghijkmnpqstuvxyz") === + false + ); + assert( + isAlienSorted(["apple", "app"], "abcdefghijklmnopqrstuvwxyz") === false + ); +}); diff --git a/testUtilities/BinaryTree.test.ts b/testUtilities/BinaryTree.test.ts deleted file mode 100644 index 08512d5..0000000 --- a/testUtilities/BinaryTree.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { createBinaryTreeNode } from "./BinaryTree"; - -describe("createBinaryTreeNode", () => { - it("creates BinaryTreeNode by an array #1", () => { - expect(createBinaryTreeNode([1, 2, 3])).toEqual({ - val: 1, - left: { - val: 2, - left: null, - right: null - }, - right: { - val: 3, - left: null, - right: null - } - }); - }); - - it("creates BinaryTreeNode by an array #2", () => { - expect(createBinaryTreeNode([1, null, 2, 3])).toEqual({ - val: 1, - left: null, - right: { - val: 2, - left: { - val: 3, - left: null, - right: null - }, - right: null - } - }); - }); - - it("creates BinaryTreeNode by an array #3", () => { - expect( - createBinaryTreeNode([5, 4, 7, 3, null, 2, null, -1, null, 9]) - ).toEqual({ - val: 5, - left: { - val: 4, - left: { - val: 3, - left: { - val: -1, - left: null, - right: null - }, - right: null - }, - right: null - }, - right: { - val: 7, - left: { - val: 2, - left: { - val: 9, - left: null, - right: null - }, - right: null - }, - right: null - } - }); - }); - - it("returns null by an empty array", () => { - expect(createBinaryTreeNode([])).toEqual(null); - }); -}); diff --git a/testUtilities/LinkedList.test.ts b/testUtilities/LinkedList.test.ts deleted file mode 100644 index c9c2d7f..0000000 --- a/testUtilities/LinkedList.test.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { createSinglyLinkedListNode, getNthNode } from "./LinkedList"; - -describe("createSinglyLinkedListNode", () => { - test("creates SinglyLinkedListNode by an array #1", () => { - expect(createSinglyLinkedListNode([1, 2, 3, 4, 5, 6, 7])).toEqual({ - val: 1, - next: { - val: 2, - next: { - val: 3, - next: { - val: 4, - next: { - val: 5, - next: { - val: 6, - next: { - val: 7, - next: null - } - } - } - } - } - } - }); - }); - - test("creates SinglyLinkedListNode by an array #2", () => { - expect(createSinglyLinkedListNode([1])).toEqual({ - val: 1, - next: null - }); - }); - - test("returns null if the given array has no element", () => { - expect(createSinglyLinkedListNode([])).toBe(null); - }); -}); - -describe("getNthNode()", () => { - it("returns the first node in a linked list if called with 0 index", () => { - const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; - - expect(getNthNode(head, 0).val).toBe(0); - }); - - it("returns the 3rd node in a linked list if called with 2 index", () => { - const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; - - expect(getNthNode(head, 2).val).toBe(2); - }); - - it("returns the last node in a linked list if called with -1 index", () => { - const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; - - expect(getNthNode(head, -1)).toBe(getNthNode(head, 5)); - }); - - it("returns the 3rd node from the tail in a linked list if called with -3 index", () => { - const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; - - expect(getNthNode(head, -3)).toBe(getNthNode(head, 3)); - }); - - it("doesn't mutates the given linked list at all", () => { - const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; - - getNthNode(head, 1); - getNthNode(head, 2); - getNthNode(head, 3); - - expect(getNthNode(head, 2).val).toBe(2); - }); - - it("throws an Error if the index is out of bounds (when called with 7 for a 6-nodes linked list)", () => { - const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; - - expect(() => getNthNode(head, 7)).toThrow(Error); - }); - - it("throws an Error if the index is out of bounds (when called with -7 for a 6-nodes linked list)", () => { - const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; - - expect(() => getNthNode(head, -7)).toThrow(Error); - }); - - it("throws a TypeError if the index is not an integer", () => { - const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; - - expect(() => getNthNode(head, 1.1)).toThrow(TypeError); - expect(() => getNthNode(head, Infinity)).toThrow(TypeError); - expect(() => getNthNode(head, -Infinity)).toThrow(TypeError); - expect(() => getNthNode(head, NaN)).toThrow(TypeError); - }); -}); diff --git a/testUtilities/BinaryTree.ts b/test_utilities/binary_tree.ts similarity index 94% rename from testUtilities/BinaryTree.ts rename to test_utilities/binary_tree.ts index 9f98ecc..be2a823 100644 --- a/testUtilities/BinaryTree.ts +++ b/test_utilities/binary_tree.ts @@ -1,4 +1,4 @@ -import { BinaryTreeNode } from "../types/BinaryTree"; +import { BinaryTreeNode } from "../types/binary_tree.ts"; export function createBinaryTreeNode( array: (T | null)[] diff --git a/test_utilities/binary_tree_test.ts b/test_utilities/binary_tree_test.ts new file mode 100644 index 0000000..62bace3 --- /dev/null +++ b/test_utilities/binary_tree_test.ts @@ -0,0 +1,53 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert, assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { createBinaryTreeNode } from "./binary_tree.ts"; + + test("createBinaryTreeNode() returns a BinaryTreeNode", () => { + assertEquals(createBinaryTreeNode([1, 2, 3]), { val: 1, left: { val: 2, left: null, right: null }, right: { val: 3, left: null, right: null }}); + assertEquals(createBinaryTreeNode([1, null, 2, 3]), { val: 1, + left: null, + right: { + val: 2, + left: { + val: 3, + left: null, + right: null + }, + right: null + }}); + assertEquals(createBinaryTreeNode([5, 4, 7, 3, null, 2, null, -1, null, 9]), { + val: 5, + left: { + val: 4, + left: { + val: 3, + left: { + val: -1, + left: null, + right: null + }, + right: null + }, + right: null + }, + right: { + val: 7, + left: { + val: 2, + left: { + val: 9, + left: null, + right: null + }, + right: null + }, + right: null + } + }); + assertEquals(createBinaryTreeNode([1, 2, 3]), { val: 1, left: { val: 2, left: null, right: null }, right: { val: 3, left: null, right: null }}); + assertEquals(createBinaryTreeNode([1, 2, 3]), { val: 1, left: { val: 2, left: null, right: null }, right: { val: 3, left: null, right: null }}); + }); + + test("createBinaryTreeNode() returns null when the given array is empty", () => { + assert(createBinaryTreeNode([]) === null); + }); \ No newline at end of file diff --git a/testUtilities/LinkedList.ts b/test_utilities/linked_list.ts similarity index 93% rename from testUtilities/LinkedList.ts rename to test_utilities/linked_list.ts index 8cb60c4..1a16e6e 100644 --- a/testUtilities/LinkedList.ts +++ b/test_utilities/linked_list.ts @@ -1,4 +1,4 @@ -import { SinglyLinkedListNode } from "../types/LinkedList"; +import { SinglyLinkedListNode } from "../types/linked_list.ts"; export function createSinglyLinkedListNode( array: T[] diff --git a/test_utilities/linked_list_test.ts b/test_utilities/linked_list_test.ts new file mode 100644 index 0000000..c2a89a4 --- /dev/null +++ b/test_utilities/linked_list_test.ts @@ -0,0 +1,67 @@ +import { test } from "https://deno.land/std/testing/mod.ts"; +import { assert, assertEquals, assertThrows } from "https://deno.land/std/testing/asserts.ts"; +import { createSinglyLinkedListNode, getNthNode } from "./linked_list.ts"; + + + test("createSinglyLinkedListNode() returns a SinglyLinkedListNode by the given array", () => { + assertEquals(createSinglyLinkedListNode([1, 2, 3, 4, 5, 6, 7]), { + val: 1, + next: { + val: 2, + next: { + val: 3, + next: { + val: 4, + next: { + val: 5, + next: { + val: 6, + next: { + val: 7, + next: null + } + } + } + } + } + } + }); + assertEquals(createSinglyLinkedListNode([1]), { + val: 1, + next: null + }); + }); + + test("createSinglyLinkedListNode() returns null if the given array is empty", () => { + assert(createSinglyLinkedListNode([]) === null); + }); + + + test("getNthNode(node, n) returns the n-th node", () => { + assert(getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, 0).val === 0); + assert(getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, 2).val === 2); + assert(getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, -1).val === 5); + assert(getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, -3).val === 3); + }); + + test("getNthNode(node, n) doesn't mutates the given linked list", () => { + const head = createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!; + + getNthNode(head, 1); + getNthNode(head, 2); + getNthNode(head, 3); + + assert(getNthNode(head, 2).val === 2); + }); + + test("getNthNode(node, n) throws an Error if the given index is out of bounds", () => { + assertThrows(() => getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, 7), Error); + assertThrows(() => getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, -7), Error); + }); + + test("getNthNode(node, n) throws a TypeError if the given index is not an integer", () => { + assertThrows(() => getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, 1.1), TypeError); + assertThrows(() => getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, Infinity), TypeError); + assertThrows(() => getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, -Infinity), TypeError); + assertThrows(() => getNthNode(createSinglyLinkedListNode([0, 1, 2, 3, 4, 5])!, NaN), TypeError); + }); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 3b38d7f..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "incremental": true, - "target": "es2017", - "noEmit": true, - "strict": true, - "noImplicitAny": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "strictBindCallApply": true, - "strictPropertyInitialization": true, - "noImplicitThis": true, - "alwaysStrict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "forceConsistentCasingInFileNames": true - }, - "exclude": ["node_modules"] -} diff --git a/types/BinaryTree.ts b/types/binary_tree.ts similarity index 100% rename from types/BinaryTree.ts rename to types/binary_tree.ts diff --git a/types/LinkedList.ts b/types/linked_list.ts similarity index 100% rename from types/LinkedList.ts rename to types/linked_list.ts