├── .gitignore ├── LICENSE ├── README.md ├── config.example.yml ├── data_structures ├── iterator │ ├── ints.go │ └── iterator.go ├── list │ ├── doubly_linked_node.go │ ├── doubly_linked_node_decoder.go │ ├── node.go │ ├── node_decoder.go │ └── utils.go ├── pq │ └── ints_priority_queue.go ├── queue │ └── queue.go ├── stack │ └── stack.go └── tree │ ├── binary_tree.go │ ├── binary_tree_decoder.go │ ├── binary_tree_node.go │ ├── binary_tree_node_decoder.go │ ├── bst_node.go │ ├── bst_node_decoder.go │ └── utils.go ├── docs ├── progress_8_10.png ├── progress_8_10_v.png └── progress_all.png ├── epi ├── ab_sqrt_2 │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── absent_value_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── adding_credits │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── advance_by_offsets │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── alternating_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── anagrams │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── apply_permutation │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── arbitrage │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── binomial_coefficients │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── bonus │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── bst_from_preorder │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── bst_from_sorted_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── bst_merge │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── bst_to_sorted_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── buy_and_sell_stock │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── buy_and_sell_stock_k_times │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── buy_and_sell_stock_twice │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── calendar_rendering │ ├── event.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── circular_queue │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── closest_int_same_weight │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── collatz_checker │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── combinations │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── convert_base │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── copy_posting_list │ ├── main_test.go │ ├── posting_list_node.go │ ├── solution.go │ └── solution_test.go ├── count_bits │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── count_inversions │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── deadlock_detection │ ├── graph_vertex.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── defective_jugs │ ├── jug.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── delete_from_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── delete_kth_last_from_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── delete_node_from_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── descendant_and_ancestor_in_bst │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── directory_path_normalization │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── do_lists_overlap │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── do_terminated_lists_overlap │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── drawing_skyline │ ├── main_test.go │ ├── rect.go │ ├── solution.go │ └── solution_test.go ├── dutch_national_flag │ ├── color.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── element_appearing_once │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── enumerate_balanced_parentheses │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── enumerate_palindromic_decompositions │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── enumerate_trees │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── euclidean_gcd │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── evaluate_rpn │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── even_odd_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── even_odd_list_merge │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── fibonacci │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── find_salary_threshold │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── first_missing_positive_entry │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── gcd │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── graph_clone │ ├── graph_vertex.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── gray_code │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── group_equal_entries │ ├── main_test.go │ ├── person.go │ ├── solution.go │ └── solution_test.go ├── h_index │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── hanoi │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── huffman_coding │ ├── char_with_frequency.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── insert_in_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── insert_operators_in_string │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── int_as_array_increment │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── int_as_array_multiply │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── int_as_list_add │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── int_square_root │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── intersect_sorted_arrays │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── interval_add │ ├── interval.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── intervals_union │ ├── interval.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_anonymous_letter_constructible │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_array_dominated │ ├── main_test.go │ ├── solution.go │ ├── solution_test.go │ └── team.go ├── is_circuit_wirable │ ├── main_test.go │ ├── solution.go │ ├── solution_test.go │ └── vertex.go ├── is_list_cyclic │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_list_palindromic │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_number_palindromic │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_string_decomposable_into_words │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_string_in_matrix │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_string_palindromic │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_string_palindromic_punctuation │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_string_permutable_to_palindrome │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_tree_a_bst │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_tree_balanced │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_tree_symmetric │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_valid_parenthesization │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── is_valid_sudoku │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── k_closest_stars │ ├── main_test.go │ ├── solution.go │ ├── solution_test.go │ └── star.go ├── k_largest_in_heap │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── k_largest_values_in_bst │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── knapsack │ ├── item.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── kth_largest_element_in_long_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── kth_largest_element_in_two_sorted_arrays │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── kth_largest_in_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── kth_node_in_tree │ ├── main_test.go │ ├── node.go │ ├── solution.go │ └── solution_test.go ├── largest_rectangle_under_skyline │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── left_right_justify_text │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── levenshtein_distance │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── line_through_most_points │ ├── main_test.go │ ├── point.go │ ├── solution.go │ └── solution_test.go ├── list_cyclic_right_shift │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── longest_contained_interval │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── longest_increasing_subarray │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── longest_nondecreasing_subsequence │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── longest_subarray_with_distinct_values │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── longest_subarray_with_sum_constraint │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── longest_substring_with_matching_parentheses │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── look_and_say │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── lowest_common_ancestor │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── lowest_common_ancestor_close_ancestor │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── lowest_common_ancestor_in_bst │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── lowest_common_ancestor_with_parent │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── lru_cache │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── majority_element │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── making_change │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── matrix_connected_regions │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── matrix_enclosed_regions │ ├── color.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── matrix_rotation │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── max_of_sliding_window │ ├── main_test.go │ ├── solution.go │ ├── solution_test.go │ └── traffic_element.go ├── max_product_all_but_one │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── max_safe_height │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── max_square_submatrix │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── max_submatrix │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── max_sum_subarray │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── max_teams_in_photograph │ ├── graph_vertex.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── max_trapped_water │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── max_water_trappable │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── maximum_subarray_in_circular_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── minimum_distance_3_sorted_arrays │ ├── array_data.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── minimum_points_covering_intervals │ ├── interval.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── minimum_waiting_time │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── minimum_weight_path_in_a_triangle │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── n_queens │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── nearest_repeated_entries │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── next_permutation │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── nonuniform_random_number │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── number_of_score_combinations │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── number_of_traversals_matrix │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── number_of_traversals_staircase │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── offline_sampling │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── online_median │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── online_sampling │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── parity │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── pascal_triangle │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── path_sum │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── permutations │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── phone_number_mnemonic │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── picking_up_coins │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── pivot_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── power_set │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── power_xy │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── pretty_printing │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── prime_sieve │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── primitive_divide │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── primitive_multiply │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── queue_from_stacks │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── queue_with_max │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── random_permutation │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── random_subset │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── range_lookup_in_bst │ ├── interval.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── real_square_root │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── rectangle_intersection │ ├── main_test.go │ ├── rect.go │ ├── solution.go │ └── solution_test.go ├── refueling_schedule │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── regular_expression │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── remove_duplicates │ ├── main_test.go │ ├── name.go │ ├── solution.go │ └── solution_test.go ├── remove_duplicates_from_sorted_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── replace_and_remove │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── reverse_bits │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── reverse_digits │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── reverse_sublist │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── reverse_words │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── road_network │ ├── highway_section.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── roman_to_integer │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── rook_attack │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── rotate_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── run_length_compression │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_entry_equal_to_index │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_first_greater_value_in_bst │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_first_key │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_for_min_max_in_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_for_missing_element │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_frequent_items │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_in_bst │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_in_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_maze │ ├── color.go │ ├── coordinate.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_row_col_sorted_matrix │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_shifted_sorted_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── search_unknown_length_array │ ├── array_unknown_length.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── smallest_nonconstructible_value │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── smallest_subarray_covering_all_values │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── smallest_subarray_covering_set │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── snake_string │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sort_almost_sorted_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sort_increasing_decreasing_array │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sort_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sorted_array_remove_dups │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sorted_arrays_merge │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sorted_list_to_bst │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sorted_lists_merge │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── spiral_ordering │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── spreadsheet_encoding │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── stack_with_max │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── string_decompositions_into_dictionary_words │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── string_integer_interconversion │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── string_transformability │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── substring_match │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── successor_in_tree │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sudoku_solve │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sum_root_to_leaf │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── sunset_view │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── swap_bits │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── task_pairing │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── three_sum │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_connect_leaves │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_exterior │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_from_preorder_inorder │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_from_preorder_with_null │ ├── int_or_null.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_inorder │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_level_order │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_postorder │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_preorder │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_right_sibling │ ├── binary_tree_node_with_next.go │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── tree_with_parent_inorder │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── two_sorted_arrays_merge │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── two_sum │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── uniform_random_number │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── valid_ip_addresses │ ├── main_test.go │ ├── solution.go │ └── solution_test.go └── zip_list │ ├── main_test.go │ ├── solution.go │ └── solution_test.go ├── go.mod ├── go.sum ├── progress ├── aggregator.go ├── lib │ └── test_result.go ├── main.go ├── problem_mapping.go └── test_results.go └── test_utils ├── assert.go ├── compare.go ├── config └── config.go ├── fmt.go ├── math.go ├── reflect_names.go └── stats ├── binomial_coefficient.go ├── retries.go └── uniform.go /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | config.yml 3 | .DS_Store 4 | .progress 5 | -------------------------------------------------------------------------------- /config.example.yml: -------------------------------------------------------------------------------- 1 | testDataFolder: 2 | runParallelTests: true 3 | -------------------------------------------------------------------------------- /data_structures/iterator/ints.go: -------------------------------------------------------------------------------- 1 | package iterator 2 | 3 | type Ints []int 4 | 5 | func (i Ints) Len() int { 6 | return len(i) 7 | } 8 | 9 | func (i Ints) Get(idx int) interface{} { 10 | return i[idx] 11 | } 12 | -------------------------------------------------------------------------------- /data_structures/list/doubly_linked_node.go: -------------------------------------------------------------------------------- 1 | package list 2 | 3 | type DoublyLinkedNode struct { 4 | Data int 5 | Prev, Next *DoublyLinkedNode 6 | } 7 | -------------------------------------------------------------------------------- /docs/progress_8_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefantds/go-epi-judge/19f1595af48547ea23b2cc059d8f2c9fd360b9e4/docs/progress_8_10.png -------------------------------------------------------------------------------- /docs/progress_8_10_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefantds/go-epi-judge/19f1595af48547ea23b2cc059d8f2c9fd360b9e4/docs/progress_8_10_v.png -------------------------------------------------------------------------------- /docs/progress_all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stefantds/go-epi-judge/19f1595af48547ea23b2cc059d8f2c9fd360b9e4/docs/progress_all.png -------------------------------------------------------------------------------- /epi/ab_sqrt_2/main_test.go: -------------------------------------------------------------------------------- 1 | package ab_sqrt_2_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/ab_sqrt_2/solution.go: -------------------------------------------------------------------------------- 1 | package ab_sqrt_2 2 | 3 | func GenerateFirstKABSqrt2(k int) []float64 { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/absent_value_array/main_test.go: -------------------------------------------------------------------------------- 1 | package absent_value_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/absent_value_array/solution.go: -------------------------------------------------------------------------------- 1 | package absent_value_array 2 | 3 | // ResetIterator has a metgod Iterator that returns a new channel 4 | // containing the same stream of values every time. 5 | // It effectively allows to reset the channel and read again from it multiple times. 6 | type ResetIterator interface { 7 | Iterator() <-chan int32 8 | } 9 | 10 | func FindMissingElement(stream ResetIterator) int32 { 11 | // TODO - Add your code here 12 | return 0 13 | } 14 | -------------------------------------------------------------------------------- /epi/adding_credits/main_test.go: -------------------------------------------------------------------------------- 1 | package adding_credits_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/advance_by_offsets/main_test.go: -------------------------------------------------------------------------------- 1 | package advance_by_offsets_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/advance_by_offsets/solution.go: -------------------------------------------------------------------------------- 1 | package advance_by_offsets 2 | 3 | func CanReachEnd(maxAdvanceSteps []int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/alternating_array/main_test.go: -------------------------------------------------------------------------------- 1 | package alternating_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/alternating_array/solution.go: -------------------------------------------------------------------------------- 1 | package alternating_array 2 | 3 | func Rearrange(a []int) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/anagrams/main_test.go: -------------------------------------------------------------------------------- 1 | package anagrams_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/anagrams/solution.go: -------------------------------------------------------------------------------- 1 | package anagrams 2 | 3 | func FindAnagrams(dictionary []string) [][]string { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/apply_permutation/main_test.go: -------------------------------------------------------------------------------- 1 | package apply_permutation_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/apply_permutation/solution.go: -------------------------------------------------------------------------------- 1 | package apply_permutation 2 | 3 | func ApplyPermutation(perm []int, a []int) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/arbitrage/main_test.go: -------------------------------------------------------------------------------- 1 | package arbitrage_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/arbitrage/solution.go: -------------------------------------------------------------------------------- 1 | package arbitrage 2 | 3 | func IsArbitrageExist(graph [][]float64) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/binomial_coefficients/main_test.go: -------------------------------------------------------------------------------- 1 | package binomial_coefficients_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/binomial_coefficients/solution.go: -------------------------------------------------------------------------------- 1 | package binomial_coefficients 2 | 3 | func ComputeBinomialCoefficient(n int, k int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/bonus/main_test.go: -------------------------------------------------------------------------------- 1 | package bonus_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/bonus/solution.go: -------------------------------------------------------------------------------- 1 | package bonus 2 | 3 | func CalculateBonus(productivity []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/bst_from_preorder/main_test.go: -------------------------------------------------------------------------------- 1 | package bst_from_preorder_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/bst_from_preorder/solution.go: -------------------------------------------------------------------------------- 1 | package bst_from_preorder 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func RebuildBSTFromPreorder(preorderSequence []int) *tree.BSTNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/bst_from_sorted_array/main_test.go: -------------------------------------------------------------------------------- 1 | package bst_from_sorted_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/bst_from_sorted_array/solution.go: -------------------------------------------------------------------------------- 1 | package bst_from_sorted_array 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func BuildMinHeightBSTFromSortedArray(a []int) *tree.BSTNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/bst_merge/main_test.go: -------------------------------------------------------------------------------- 1 | package bst_merge_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/bst_merge/solution.go: -------------------------------------------------------------------------------- 1 | package bst_merge 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func MergeTwoBsts(a *tree.BSTNode, b *tree.BSTNode) *tree.BSTNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/bst_to_sorted_list/main_test.go: -------------------------------------------------------------------------------- 1 | package bst_to_sorted_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/bst_to_sorted_list/solution.go: -------------------------------------------------------------------------------- 1 | package bst_to_sorted_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func BstToDoublyLinkedList(t *tree.BSTNode) *tree.BSTNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/buy_and_sell_stock/main_test.go: -------------------------------------------------------------------------------- 1 | package buy_and_sell_stock_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/buy_and_sell_stock/solution.go: -------------------------------------------------------------------------------- 1 | package buy_and_sell_stock 2 | 3 | func ComputeMaxProfit(prices []float64) float64 { 4 | // TODO - Add your code here 5 | return 0.0 6 | } 7 | -------------------------------------------------------------------------------- /epi/buy_and_sell_stock_k_times/main_test.go: -------------------------------------------------------------------------------- 1 | package buy_and_sell_stock_k_times_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/buy_and_sell_stock_k_times/solution.go: -------------------------------------------------------------------------------- 1 | package buy_and_sell_stock_k_times 2 | 3 | func BuyAndSellStockKTimes(prices []float64, k int) float64 { 4 | // TODO - Add your code here 5 | return 0.0 6 | } 7 | -------------------------------------------------------------------------------- /epi/buy_and_sell_stock_twice/main_test.go: -------------------------------------------------------------------------------- 1 | package buy_and_sell_stock_twice_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/buy_and_sell_stock_twice/solution.go: -------------------------------------------------------------------------------- 1 | package buy_and_sell_stock_twice 2 | 3 | func BuyAndSellStockTwice(prices []float64) float64 { 4 | // TODO - Add your code here 5 | return 0.0 6 | } 7 | -------------------------------------------------------------------------------- /epi/calendar_rendering/event.go: -------------------------------------------------------------------------------- 1 | package calendar_rendering 2 | 3 | type Event struct { 4 | Start int 5 | Finish int 6 | } 7 | -------------------------------------------------------------------------------- /epi/calendar_rendering/main_test.go: -------------------------------------------------------------------------------- 1 | package calendar_rendering_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/calendar_rendering/solution.go: -------------------------------------------------------------------------------- 1 | package calendar_rendering 2 | 3 | func FindMaxSimultaneousEvents(a []Event) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/circular_queue/main_test.go: -------------------------------------------------------------------------------- 1 | package circular_queue_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/closest_int_same_weight/main_test.go: -------------------------------------------------------------------------------- 1 | package closest_int_same_weight_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/closest_int_same_weight/solution.go: -------------------------------------------------------------------------------- 1 | package closest_int_same_weight 2 | 3 | func ClosestIntSameBitCount(x int64) int64 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/collatz_checker/main_test.go: -------------------------------------------------------------------------------- 1 | package collatz_checker_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/collatz_checker/solution.go: -------------------------------------------------------------------------------- 1 | package collatz_checker 2 | 3 | func TestCollatzConjecture(n int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/combinations/main_test.go: -------------------------------------------------------------------------------- 1 | package combinations_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/combinations/solution.go: -------------------------------------------------------------------------------- 1 | package combinations 2 | 3 | func Combinations(n int, k int) [][]int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/convert_base/main_test.go: -------------------------------------------------------------------------------- 1 | package convert_base_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/convert_base/solution.go: -------------------------------------------------------------------------------- 1 | package convert_base 2 | 3 | func ConvertBase(numAsString string, b1 int, b2 int) string { 4 | // TODO - Add your code here 5 | return "" 6 | } 7 | -------------------------------------------------------------------------------- /epi/copy_posting_list/main_test.go: -------------------------------------------------------------------------------- 1 | package copy_posting_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/copy_posting_list/posting_list_node.go: -------------------------------------------------------------------------------- 1 | package copy_posting_list 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | ) 7 | 8 | type PostingListNode struct { 9 | Order int 10 | Next, Jump *PostingListNode 11 | } 12 | 13 | func (l PostingListNode) String() string { 14 | var buf bytes.Buffer 15 | for current := &l; current != nil; current = current.Next { 16 | fmt.Fprintf(&buf, "%v -> ", current.Order) 17 | } 18 | fmt.Fprintf(&buf, "%v", nil) 19 | return buf.String() 20 | } 21 | -------------------------------------------------------------------------------- /epi/copy_posting_list/solution.go: -------------------------------------------------------------------------------- 1 | package copy_posting_list 2 | 3 | func CopyPostingsList(l *PostingListNode) *PostingListNode { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/count_bits/main_test.go: -------------------------------------------------------------------------------- 1 | package count_bits_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/count_bits/solution.go: -------------------------------------------------------------------------------- 1 | package count_bits 2 | 3 | func CountBits(x int) int16 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/count_inversions/main_test.go: -------------------------------------------------------------------------------- 1 | package count_inversions_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/count_inversions/solution.go: -------------------------------------------------------------------------------- 1 | package count_inversions 2 | 3 | func CountInversions(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/deadlock_detection/graph_vertex.go: -------------------------------------------------------------------------------- 1 | package deadlock_detection 2 | 3 | type GraphVertex struct { 4 | Edges []*GraphVertex 5 | } 6 | -------------------------------------------------------------------------------- /epi/deadlock_detection/main_test.go: -------------------------------------------------------------------------------- 1 | package deadlock_detection_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/deadlock_detection/solution.go: -------------------------------------------------------------------------------- 1 | package deadlock_detection 2 | 3 | func IsDeadlocked(graph []GraphVertex) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/defective_jugs/jug.go: -------------------------------------------------------------------------------- 1 | package defective_jugs 2 | 3 | type Jug struct { 4 | Low int 5 | High int 6 | } 7 | -------------------------------------------------------------------------------- /epi/defective_jugs/main_test.go: -------------------------------------------------------------------------------- 1 | package defective_jugs_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/defective_jugs/solution.go: -------------------------------------------------------------------------------- 1 | package defective_jugs 2 | 3 | func CheckFeasible(jugs []Jug, l int, h int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/delete_from_list/main_test.go: -------------------------------------------------------------------------------- 1 | package delete_from_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/delete_from_list/solution.go: -------------------------------------------------------------------------------- 1 | package delete_from_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func DeleteList(aNode *list.Node) { 8 | // TODO - Add your code here 9 | } 10 | -------------------------------------------------------------------------------- /epi/delete_kth_last_from_list/main_test.go: -------------------------------------------------------------------------------- 1 | package delete_kth_last_from_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/delete_kth_last_from_list/solution.go: -------------------------------------------------------------------------------- 1 | package delete_kth_last_from_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func RemoveKthLast(l *list.Node, k int) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/delete_node_from_list/main_test.go: -------------------------------------------------------------------------------- 1 | package delete_node_from_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/delete_node_from_list/solution.go: -------------------------------------------------------------------------------- 1 | package delete_node_from_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func DeletionFromList(nodeToDelete *list.Node) { 8 | // TODO - Add your code here 9 | } 10 | -------------------------------------------------------------------------------- /epi/descendant_and_ancestor_in_bst/main_test.go: -------------------------------------------------------------------------------- 1 | package descendant_and_ancestor_in_bst_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/descendant_and_ancestor_in_bst/solution.go: -------------------------------------------------------------------------------- 1 | package descendant_and_ancestor_in_bst 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func PairIncludesAncestorAndDescendantOfM(possibleAncOrDesc0 *tree.BSTNode, possibleAncOrDesc1 *tree.BSTNode, middle *tree.BSTNode) bool { 8 | // TODO - Add your code here 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /epi/directory_path_normalization/main_test.go: -------------------------------------------------------------------------------- 1 | package directory_path_normalization_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/directory_path_normalization/solution.go: -------------------------------------------------------------------------------- 1 | package directory_path_normalization 2 | 3 | func ShortestEquivalentPath(path string) string { 4 | // TODO - Add your code here 5 | return "" 6 | } 7 | -------------------------------------------------------------------------------- /epi/do_lists_overlap/main_test.go: -------------------------------------------------------------------------------- 1 | package do_lists_overlap_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/do_lists_overlap/solution.go: -------------------------------------------------------------------------------- 1 | package do_lists_overlap 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func OverlappingLists(l0 *list.Node, l1 *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/do_terminated_lists_overlap/main_test.go: -------------------------------------------------------------------------------- 1 | package do_terminated_lists_overlap_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/do_terminated_lists_overlap/solution.go: -------------------------------------------------------------------------------- 1 | package do_terminated_lists_overlap 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func OverlappingNoCycleLists(l0 *list.Node, l1 *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/drawing_skyline/main_test.go: -------------------------------------------------------------------------------- 1 | package drawing_skyline_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/drawing_skyline/rect.go: -------------------------------------------------------------------------------- 1 | package drawing_skyline 2 | 3 | type Rect struct { 4 | Left int 5 | Right int 6 | Height int 7 | } 8 | -------------------------------------------------------------------------------- /epi/drawing_skyline/solution.go: -------------------------------------------------------------------------------- 1 | package drawing_skyline 2 | 3 | func DrawingSkylines(buildings []Rect) []Rect { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/dutch_national_flag/color.go: -------------------------------------------------------------------------------- 1 | package dutch_national_flag 2 | 3 | type Color int 4 | 5 | const ( 6 | Red Color = iota 7 | White 8 | Blue 9 | ) 10 | -------------------------------------------------------------------------------- /epi/dutch_national_flag/main_test.go: -------------------------------------------------------------------------------- 1 | package dutch_national_flag_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/dutch_national_flag/solution.go: -------------------------------------------------------------------------------- 1 | package dutch_national_flag 2 | 3 | func DutchFlagPartition(pivotIndex int, a []Color) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/element_appearing_once/main_test.go: -------------------------------------------------------------------------------- 1 | package element_appearing_once_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/element_appearing_once/solution.go: -------------------------------------------------------------------------------- 1 | package element_appearing_once 2 | 3 | func FindElementAppearsOnce(a []int64) int64 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/enumerate_balanced_parentheses/main_test.go: -------------------------------------------------------------------------------- 1 | package enumerate_balanced_parentheses_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/enumerate_balanced_parentheses/solution.go: -------------------------------------------------------------------------------- 1 | package enumerate_balanced_parentheses 2 | 3 | func GenerateBalancedParentheses(numPairs int) []string { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/enumerate_palindromic_decompositions/solution.go: -------------------------------------------------------------------------------- 1 | package enumerate_palindromic_decompositions 2 | 3 | func PalindromeDecompositions(text string) [][]string { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/enumerate_trees/main_test.go: -------------------------------------------------------------------------------- 1 | package enumerate_trees_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/enumerate_trees/solution.go: -------------------------------------------------------------------------------- 1 | package enumerate_trees 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func GenerateAllBinaryTrees(numNodes int) []*tree.BinaryTreeNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/euclidean_gcd/main_test.go: -------------------------------------------------------------------------------- 1 | package euclidean_gcd_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/euclidean_gcd/solution.go: -------------------------------------------------------------------------------- 1 | package euclidean_gcd 2 | 3 | func EuclideanGCD(x int, y int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/evaluate_rpn/main_test.go: -------------------------------------------------------------------------------- 1 | package evaluate_rpn_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/evaluate_rpn/solution.go: -------------------------------------------------------------------------------- 1 | package evaluate_rpn 2 | 3 | func Eval(expression string) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/even_odd_array/main_test.go: -------------------------------------------------------------------------------- 1 | package even_odd_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/even_odd_array/solution.go: -------------------------------------------------------------------------------- 1 | package even_odd_array 2 | 3 | func EvenOdd(a []int) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/even_odd_list_merge/main_test.go: -------------------------------------------------------------------------------- 1 | package even_odd_list_merge_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/even_odd_list_merge/solution.go: -------------------------------------------------------------------------------- 1 | package even_odd_list_merge 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func EvenOddMerge(l *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/fibonacci/main_test.go: -------------------------------------------------------------------------------- 1 | package fibonacci_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/fibonacci/solution.go: -------------------------------------------------------------------------------- 1 | package fibonacci 2 | 3 | func Fibonacci(n int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/find_salary_threshold/main_test.go: -------------------------------------------------------------------------------- 1 | package find_salary_threshold_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/find_salary_threshold/solution.go: -------------------------------------------------------------------------------- 1 | package find_salary_threshold 2 | 3 | func FindSalaryCap(targetPayroll int, currentSalaries []int) float64 { 4 | // TODO - Add your code here 5 | return 0.0 6 | } 7 | -------------------------------------------------------------------------------- /epi/first_missing_positive_entry/main_test.go: -------------------------------------------------------------------------------- 1 | package first_missing_positive_entry_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/first_missing_positive_entry/solution.go: -------------------------------------------------------------------------------- 1 | package first_missing_positive_entry 2 | 3 | func FindFirstMissingPositive(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/gcd/main_test.go: -------------------------------------------------------------------------------- 1 | package gcd_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/gcd/solution.go: -------------------------------------------------------------------------------- 1 | package gcd 2 | 3 | func GCD(x int64, y int64) int64 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/graph_clone/graph_vertex.go: -------------------------------------------------------------------------------- 1 | package graph_clone 2 | 3 | type GraphVertex struct { 4 | Label int 5 | Edges []*GraphVertex 6 | } 7 | -------------------------------------------------------------------------------- /epi/graph_clone/main_test.go: -------------------------------------------------------------------------------- 1 | package graph_clone_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/graph_clone/solution.go: -------------------------------------------------------------------------------- 1 | package graph_clone 2 | 3 | func CloneGraph(graph *GraphVertex) *GraphVertex { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/gray_code/main_test.go: -------------------------------------------------------------------------------- 1 | package gray_code_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/gray_code/solution.go: -------------------------------------------------------------------------------- 1 | package gray_code 2 | 3 | func GrayCode(numBits int) []int64 { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/group_equal_entries/main_test.go: -------------------------------------------------------------------------------- 1 | package group_equal_entries_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/group_equal_entries/person.go: -------------------------------------------------------------------------------- 1 | package group_equal_entries 2 | 3 | type Person struct { 4 | Age int 5 | Name string 6 | } 7 | -------------------------------------------------------------------------------- /epi/group_equal_entries/solution.go: -------------------------------------------------------------------------------- 1 | package group_equal_entries 2 | 3 | func GroupByAge(people []Person) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/h_index/main_test.go: -------------------------------------------------------------------------------- 1 | package h_index_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/h_index/solution.go: -------------------------------------------------------------------------------- 1 | package h_index 2 | 3 | func HIndex(citations []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/hanoi/main_test.go: -------------------------------------------------------------------------------- 1 | package hanoi_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/hanoi/solution.go: -------------------------------------------------------------------------------- 1 | package hanoi 2 | 3 | // only 3 pegs are supported, don't change this 4 | const NumPegs = 3 5 | 6 | func ComputeTowerHanoi(numRings int) [][]int { 7 | // TODO - Add your code here 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /epi/huffman_coding/char_with_frequency.go: -------------------------------------------------------------------------------- 1 | package huffman_coding 2 | 3 | type CharWithFrequency struct { 4 | C rune 5 | Freq float64 6 | Code string 7 | } 8 | -------------------------------------------------------------------------------- /epi/huffman_coding/main_test.go: -------------------------------------------------------------------------------- 1 | package huffman_coding_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/huffman_coding/solution.go: -------------------------------------------------------------------------------- 1 | package huffman_coding 2 | 3 | func HuffmanEncoding(symbols []CharWithFrequency) float64 { 4 | // TODO - Add your code here 5 | return 0.0 6 | } 7 | -------------------------------------------------------------------------------- /epi/insert_in_list/main_test.go: -------------------------------------------------------------------------------- 1 | package insert_in_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/insert_in_list/solution.go: -------------------------------------------------------------------------------- 1 | package insert_in_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func InsertAfter(node *list.Node, newNode *list.Node) { 8 | // TODO - Add your code here 9 | } 10 | -------------------------------------------------------------------------------- /epi/insert_operators_in_string/main_test.go: -------------------------------------------------------------------------------- 1 | package insert_operators_in_string_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/insert_operators_in_string/solution.go: -------------------------------------------------------------------------------- 1 | package insert_operators_in_string 2 | 3 | func ExpressionSynthesis(digits []int, target int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/int_as_array_increment/main_test.go: -------------------------------------------------------------------------------- 1 | package int_as_array_increment_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/int_as_array_increment/solution.go: -------------------------------------------------------------------------------- 1 | package int_as_array_increment 2 | 3 | func PlusOne(a []int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/int_as_array_multiply/main_test.go: -------------------------------------------------------------------------------- 1 | package int_as_array_multiply_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/int_as_array_multiply/solution.go: -------------------------------------------------------------------------------- 1 | package int_as_array_multiply 2 | 3 | func Multiply(num1 []int, num2 []int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/int_as_list_add/main_test.go: -------------------------------------------------------------------------------- 1 | package int_as_list_add_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/int_as_list_add/solution.go: -------------------------------------------------------------------------------- 1 | package int_as_list_add 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func AddTwoNumbers(l1 *list.Node, l2 *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/int_square_root/main_test.go: -------------------------------------------------------------------------------- 1 | package int_square_root_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/int_square_root/solution.go: -------------------------------------------------------------------------------- 1 | package int_square_root 2 | 3 | func SquareRoot(k int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/intersect_sorted_arrays/main_test.go: -------------------------------------------------------------------------------- 1 | package intersect_sorted_arrays_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/intersect_sorted_arrays/solution.go: -------------------------------------------------------------------------------- 1 | package intersect_sorted_arrays 2 | 3 | func IntersectTwoSortedArrays(a []int, b []int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/interval_add/interval.go: -------------------------------------------------------------------------------- 1 | package interval_add 2 | 3 | type Interval struct { 4 | Left int 5 | Right int 6 | } 7 | -------------------------------------------------------------------------------- /epi/interval_add/main_test.go: -------------------------------------------------------------------------------- 1 | package interval_add_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/interval_add/solution.go: -------------------------------------------------------------------------------- 1 | package interval_add 2 | 3 | func AddInterval(disjointIntervals []Interval, newInterval Interval) []Interval { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/intervals_union/main_test.go: -------------------------------------------------------------------------------- 1 | package intervals_union_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/intervals_union/solution.go: -------------------------------------------------------------------------------- 1 | package intervals_union 2 | 3 | func UnionOfIntervals(intervals []Interval) []Interval { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_anonymous_letter_constructible/main_test.go: -------------------------------------------------------------------------------- 1 | package is_anonymous_letter_constructible_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_anonymous_letter_constructible/solution.go: -------------------------------------------------------------------------------- 1 | package is_anonymous_letter_constructible 2 | 3 | func IsLetterConstructibleFromMagazine(letterText string, magazineText string) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_array_dominated/main_test.go: -------------------------------------------------------------------------------- 1 | package is_array_dominated_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_array_dominated/solution.go: -------------------------------------------------------------------------------- 1 | package is_array_dominated 2 | 3 | func ValidPlacementExists(team0 Team, team1 Team) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_array_dominated/team.go: -------------------------------------------------------------------------------- 1 | package is_array_dominated 2 | 3 | type Player struct { 4 | Height int 5 | } 6 | 7 | type Team struct { 8 | Players []Player 9 | } 10 | -------------------------------------------------------------------------------- /epi/is_circuit_wirable/main_test.go: -------------------------------------------------------------------------------- 1 | package is_circuit_wirable_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_circuit_wirable/solution.go: -------------------------------------------------------------------------------- 1 | package is_circuit_wirable 2 | 3 | func IsAnyPlacementFeasible(graph []GraphVertex) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_circuit_wirable/vertex.go: -------------------------------------------------------------------------------- 1 | package is_circuit_wirable 2 | 3 | type GraphVertex struct { 4 | Edges []*GraphVertex 5 | // TODO - Add more fields here (if needed) 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_list_cyclic/main_test.go: -------------------------------------------------------------------------------- 1 | package is_list_cyclic_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_list_cyclic/solution.go: -------------------------------------------------------------------------------- 1 | package is_list_cyclic 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func HasCycle(head *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/is_list_palindromic/main_test.go: -------------------------------------------------------------------------------- 1 | package is_list_palindromic_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_list_palindromic/solution.go: -------------------------------------------------------------------------------- 1 | package is_list_palindromic 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func IsLinkedListAPalindrome(l *list.Node) bool { 8 | // TODO - Add your code here 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /epi/is_number_palindromic/main_test.go: -------------------------------------------------------------------------------- 1 | package is_number_palindromic_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_number_palindromic/solution.go: -------------------------------------------------------------------------------- 1 | package is_number_palindromic 2 | 3 | func IsPalindromeNumber(x int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_string_decomposable_into_words/main_test.go: -------------------------------------------------------------------------------- 1 | package is_string_decomposable_into_words_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_string_decomposable_into_words/solution.go: -------------------------------------------------------------------------------- 1 | package is_string_decomposable_into_words 2 | 3 | func DecomposeIntoDictionaryWords(domain string, dictionary map[string]struct{}) []string { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_string_in_matrix/main_test.go: -------------------------------------------------------------------------------- 1 | package is_string_in_matrix_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_string_in_matrix/solution.go: -------------------------------------------------------------------------------- 1 | package is_string_in_matrix 2 | 3 | func IsPatternContainedInGrid(grid [][]int, pattern []int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_string_palindromic/main_test.go: -------------------------------------------------------------------------------- 1 | package is_string_palindromic_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_string_palindromic/solution.go: -------------------------------------------------------------------------------- 1 | package is_string_palindromic 2 | 3 | func IsPalindromic(s string) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_string_palindromic_punctuation/solution.go: -------------------------------------------------------------------------------- 1 | package is_string_palindromic_punctuation 2 | 3 | func IsPalindrome(s string) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_string_permutable_to_palindrome/solution.go: -------------------------------------------------------------------------------- 1 | package is_string_permutable_to_palindrome 2 | 3 | func CanFormPalindrome(s string) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_tree_a_bst/main_test.go: -------------------------------------------------------------------------------- 1 | package is_tree_a_bst_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_tree_a_bst/solution.go: -------------------------------------------------------------------------------- 1 | package is_tree_a_bst 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func IsBinaryTreeBST(t *tree.BinaryTreeNode) bool { 8 | // TODO - Add your code here 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /epi/is_tree_balanced/main_test.go: -------------------------------------------------------------------------------- 1 | package is_tree_balanced_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_tree_balanced/solution.go: -------------------------------------------------------------------------------- 1 | package is_tree_balanced 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func IsBalanced(t *tree.BinaryTreeNode) bool { 8 | // TODO - Add your code here 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /epi/is_tree_symmetric/main_test.go: -------------------------------------------------------------------------------- 1 | package is_tree_symmetric_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_tree_symmetric/solution.go: -------------------------------------------------------------------------------- 1 | package is_tree_symmetric 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func IsSymmetric(t *tree.BinaryTreeNode) bool { 8 | // TODO - Add your code here 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /epi/is_valid_parenthesization/main_test.go: -------------------------------------------------------------------------------- 1 | package is_valid_parenthesization_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_valid_parenthesization/solution.go: -------------------------------------------------------------------------------- 1 | package is_valid_parenthesization 2 | 3 | func IsWellFormed(s string) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/is_valid_sudoku/main_test.go: -------------------------------------------------------------------------------- 1 | package is_valid_sudoku_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/is_valid_sudoku/solution.go: -------------------------------------------------------------------------------- 1 | package is_valid_sudoku 2 | 3 | func IsValidSudoku(partialAssignment [][]int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/k_closest_stars/main_test.go: -------------------------------------------------------------------------------- 1 | package k_closest_stars_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/k_closest_stars/solution.go: -------------------------------------------------------------------------------- 1 | package k_closest_stars 2 | 3 | func FindClosestKStars(stars <-chan Star, k int) []Star { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/k_closest_stars/star.go: -------------------------------------------------------------------------------- 1 | package k_closest_stars 2 | 3 | import ( 4 | "fmt" 5 | "math" 6 | ) 7 | 8 | type Star struct { 9 | X float64 10 | Y float64 11 | Z float64 12 | } 13 | 14 | func (s Star) Distance() float64 { 15 | return math.Sqrt(s.X*s.X + s.Y*s.Y + s.Z*s.Z) 16 | } 17 | 18 | func (s Star) String() string { 19 | return fmt.Sprintf("%v", s.Distance()) 20 | } 21 | -------------------------------------------------------------------------------- /epi/k_largest_in_heap/main_test.go: -------------------------------------------------------------------------------- 1 | package k_largest_in_heap_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/k_largest_in_heap/solution.go: -------------------------------------------------------------------------------- 1 | package k_largest_in_heap 2 | 3 | func KLargestInBinaryHeap(a []int, k int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/k_largest_values_in_bst/main_test.go: -------------------------------------------------------------------------------- 1 | package k_largest_values_in_bst_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/k_largest_values_in_bst/solution.go: -------------------------------------------------------------------------------- 1 | package k_largest_values_in_bst 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func FindKLargestInBst(t *tree.BSTNode, k int) []int { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/knapsack/item.go: -------------------------------------------------------------------------------- 1 | package knapsack 2 | 3 | type Item struct { 4 | Weight int 5 | Value int 6 | } 7 | -------------------------------------------------------------------------------- /epi/knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package knapsack_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/knapsack/solution.go: -------------------------------------------------------------------------------- 1 | package knapsack 2 | 3 | func OptimumSubjectToCapacity(items []Item, capacity int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/kth_largest_element_in_long_array/solution.go: -------------------------------------------------------------------------------- 1 | package kth_largest_element_in_long_array 2 | 3 | func FindKthLargestUnknownLength(stream <-chan int, k int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/kth_largest_element_in_two_sorted_arrays/solution.go: -------------------------------------------------------------------------------- 1 | package kth_largest_element_in_two_sorted_arrays 2 | 3 | func FindKthNTwoSortedArrays(a []int, b []int, k int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/kth_largest_in_array/main_test.go: -------------------------------------------------------------------------------- 1 | package kth_largest_in_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/kth_largest_in_array/solution.go: -------------------------------------------------------------------------------- 1 | package kth_largest_in_array 2 | 3 | func FindKthLargest(k int, a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/kth_node_in_tree/main_test.go: -------------------------------------------------------------------------------- 1 | package kth_node_in_tree_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/kth_node_in_tree/node.go: -------------------------------------------------------------------------------- 1 | package kth_node_in_tree 2 | 3 | type BinaryTreeNode struct { 4 | Data int 5 | Left *BinaryTreeNode 6 | Right *BinaryTreeNode 7 | Size int 8 | } 9 | -------------------------------------------------------------------------------- /epi/kth_node_in_tree/solution.go: -------------------------------------------------------------------------------- 1 | package kth_node_in_tree 2 | 3 | func FindKthNodeBinaryTree(tree *BinaryTreeNode, k int) *BinaryTreeNode { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/largest_rectangle_under_skyline/solution.go: -------------------------------------------------------------------------------- 1 | package largest_rectangle_under_skyline 2 | 3 | func CalculateLargestRectangle(heights []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/left_right_justify_text/main_test.go: -------------------------------------------------------------------------------- 1 | package left_right_justify_text_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/left_right_justify_text/solution.go: -------------------------------------------------------------------------------- 1 | package left_right_justify_text 2 | 3 | func JustifyText(words []string, l int) []string { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/levenshtein_distance/main_test.go: -------------------------------------------------------------------------------- 1 | package levenshtein_distance_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/levenshtein_distance/solution.go: -------------------------------------------------------------------------------- 1 | package levenshtein_distance 2 | 3 | func LevenshteinDistance(a string, b string) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/line_through_most_points/main_test.go: -------------------------------------------------------------------------------- 1 | package line_through_most_points_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/line_through_most_points/point.go: -------------------------------------------------------------------------------- 1 | package line_through_most_points 2 | 3 | type Point struct { 4 | X int 5 | Y int 6 | } 7 | -------------------------------------------------------------------------------- /epi/line_through_most_points/solution.go: -------------------------------------------------------------------------------- 1 | package line_through_most_points 2 | 3 | func FindLineWithMostPoints(points []Point) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/list_cyclic_right_shift/main_test.go: -------------------------------------------------------------------------------- 1 | package list_cyclic_right_shift_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/list_cyclic_right_shift/solution.go: -------------------------------------------------------------------------------- 1 | package list_cyclic_right_shift 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func CyclicallyRightShiftList(l *list.Node, k int) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/longest_contained_interval/main_test.go: -------------------------------------------------------------------------------- 1 | package longest_contained_interval_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/longest_contained_interval/solution.go: -------------------------------------------------------------------------------- 1 | package longest_contained_interval 2 | 3 | func LongestContainedRange(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/longest_increasing_subarray/main_test.go: -------------------------------------------------------------------------------- 1 | package longest_increasing_subarray_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/longest_increasing_subarray/solution.go: -------------------------------------------------------------------------------- 1 | package longest_increasing_subarray 2 | 3 | func FindLongestIncreasingSubarray(a []int) (start, end int) { 4 | // TODO - Add your code here 5 | return 0, 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/longest_nondecreasing_subsequence/solution.go: -------------------------------------------------------------------------------- 1 | package longest_nondecreasing_subsequence 2 | 3 | func LongestNondecreasingSubsequenceLength(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/longest_subarray_with_distinct_values/solution.go: -------------------------------------------------------------------------------- 1 | package longest_subarray_with_distinct_values 2 | 3 | func LongestSubarrayWithDistinctEntries(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/longest_subarray_with_sum_constraint/solution.go: -------------------------------------------------------------------------------- 1 | package longest_subarray_with_sum_constraint 2 | 3 | func FindLongestSubarrayLessEqualK(a []int, k int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/longest_substring_with_matching_parentheses/solution.go: -------------------------------------------------------------------------------- 1 | package longest_substring_with_matching_parentheses 2 | 3 | func LongestMatchingParentheses(s string) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/look_and_say/main_test.go: -------------------------------------------------------------------------------- 1 | package look_and_say_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/look_and_say/solution.go: -------------------------------------------------------------------------------- 1 | package look_and_say 2 | 3 | func LookAndSay(n int) string { 4 | // TODO - Add your code here 5 | return "" 6 | } 7 | -------------------------------------------------------------------------------- /epi/lowest_common_ancestor/main_test.go: -------------------------------------------------------------------------------- 1 | package lowest_common_ancestor_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/lowest_common_ancestor/solution.go: -------------------------------------------------------------------------------- 1 | package lowest_common_ancestor 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func LCA(tree, node0, node1 *tree.BinaryTreeNode) *tree.BinaryTreeNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/lowest_common_ancestor_close_ancestor/solution.go: -------------------------------------------------------------------------------- 1 | package lowest_common_ancestor_close_ancestor 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func LCA(node0 *tree.BinaryTree, node1 *tree.BinaryTree) *tree.BinaryTree { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/lowest_common_ancestor_in_bst/main_test.go: -------------------------------------------------------------------------------- 1 | package lowest_common_ancestor_in_bst_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/lowest_common_ancestor_in_bst/solution.go: -------------------------------------------------------------------------------- 1 | package lowest_common_ancestor_in_bst 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func FindLCA(t *tree.BSTNode, s *tree.BSTNode, b *tree.BSTNode) *tree.BSTNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/lowest_common_ancestor_with_parent/solution.go: -------------------------------------------------------------------------------- 1 | package lowest_common_ancestor_with_parent 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func LCA(node0 *tree.BinaryTree, node1 *tree.BinaryTree) *tree.BinaryTree { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/lru_cache/main_test.go: -------------------------------------------------------------------------------- 1 | package lru_cache_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/majority_element/main_test.go: -------------------------------------------------------------------------------- 1 | package majority_element_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/majority_element/solution.go: -------------------------------------------------------------------------------- 1 | package majority_element 2 | 3 | func MajoritySearch(stream <-chan string) string { 4 | // TODO - Add your code here 5 | return "" 6 | } 7 | -------------------------------------------------------------------------------- /epi/making_change/main_test.go: -------------------------------------------------------------------------------- 1 | package making_change_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/making_change/solution.go: -------------------------------------------------------------------------------- 1 | package making_change 2 | 3 | var Coins = []int{ 4 | 100, 50, 25, 10, 5, 1, 5 | } 6 | 7 | func ChangeMaking(cents int) int { 8 | // TODO - Add your code here 9 | return 0 10 | } 11 | -------------------------------------------------------------------------------- /epi/matrix_connected_regions/main_test.go: -------------------------------------------------------------------------------- 1 | package matrix_connected_regions_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/matrix_connected_regions/solution.go: -------------------------------------------------------------------------------- 1 | package matrix_connected_regions 2 | 3 | func FlipColor(x int, y int, image [][]bool) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/matrix_enclosed_regions/color.go: -------------------------------------------------------------------------------- 1 | package matrix_enclosed_regions 2 | 3 | type Color string 4 | 5 | const ( 6 | White Color = "W" 7 | Black Color = "B" 8 | ) 9 | -------------------------------------------------------------------------------- /epi/matrix_enclosed_regions/main_test.go: -------------------------------------------------------------------------------- 1 | package matrix_enclosed_regions_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/matrix_enclosed_regions/solution.go: -------------------------------------------------------------------------------- 1 | package matrix_enclosed_regions 2 | 3 | func FillSurroundedRegions(board [][]Color) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/matrix_rotation/main_test.go: -------------------------------------------------------------------------------- 1 | package matrix_rotation_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/matrix_rotation/solution.go: -------------------------------------------------------------------------------- 1 | package matrix_rotation 2 | 3 | func RotateMatrix(squareMatrix [][]int) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/max_of_sliding_window/main_test.go: -------------------------------------------------------------------------------- 1 | package max_of_sliding_window_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_of_sliding_window/solution.go: -------------------------------------------------------------------------------- 1 | package max_of_sliding_window 2 | 3 | func ComputeTrafficVolumes(a []TrafficElement, w int) []TrafficElement { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_of_sliding_window/traffic_element.go: -------------------------------------------------------------------------------- 1 | package max_of_sliding_window 2 | 3 | type TrafficElement struct { 4 | Time int 5 | Volume float64 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_product_all_but_one/main_test.go: -------------------------------------------------------------------------------- 1 | package max_product_all_but_one_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_product_all_but_one/solution.go: -------------------------------------------------------------------------------- 1 | package max_product_all_but_one 2 | 3 | func FindBiggestProductNMinusOneProduct(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_safe_height/main_test.go: -------------------------------------------------------------------------------- 1 | package max_safe_height_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_safe_height/solution.go: -------------------------------------------------------------------------------- 1 | package max_safe_height 2 | 3 | func GetHeight(cases int, drops int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_square_submatrix/main_test.go: -------------------------------------------------------------------------------- 1 | package max_square_submatrix_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_square_submatrix/solution.go: -------------------------------------------------------------------------------- 1 | package max_square_submatrix 2 | 3 | func MaxSquareSubmatrix(a [][]bool) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_submatrix/main_test.go: -------------------------------------------------------------------------------- 1 | package max_submatrix_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_submatrix/solution.go: -------------------------------------------------------------------------------- 1 | package max_submatrix 2 | 3 | func MaxRectangleSubmatrix(a [][]bool) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_sum_subarray/main_test.go: -------------------------------------------------------------------------------- 1 | package max_sum_subarray_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_sum_subarray/solution.go: -------------------------------------------------------------------------------- 1 | package max_sum_subarray 2 | 3 | func FindMaximumSubarray(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_teams_in_photograph/graph_vertex.go: -------------------------------------------------------------------------------- 1 | package max_teams_in_photograph 2 | 3 | type GraphVertex struct { 4 | Edges []*GraphVertex 5 | MaxDistance int 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_teams_in_photograph/main_test.go: -------------------------------------------------------------------------------- 1 | package max_teams_in_photograph_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_teams_in_photograph/solution.go: -------------------------------------------------------------------------------- 1 | package max_teams_in_photograph 2 | 3 | func FindLargestNumberTeams(graph []GraphVertex) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_trapped_water/main_test.go: -------------------------------------------------------------------------------- 1 | package max_trapped_water_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_trapped_water/solution.go: -------------------------------------------------------------------------------- 1 | package max_trapped_water 2 | 3 | func GetMaxTrappedWater(heights []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/max_water_trappable/main_test.go: -------------------------------------------------------------------------------- 1 | package max_water_trappable_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/max_water_trappable/solution.go: -------------------------------------------------------------------------------- 1 | package max_water_trappable 2 | 3 | func CalculateTrappingWater(heights []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/maximum_subarray_in_circular_array/solution.go: -------------------------------------------------------------------------------- 1 | package maximum_subarray_in_circular_array 2 | 3 | func MaxSubarraySumInCircular(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/minimum_distance_3_sorted_arrays/array_data.go: -------------------------------------------------------------------------------- 1 | package minimum_distance_3_sorted_arrays 2 | 3 | type ArrayData struct { 4 | Val int 5 | Idx int 6 | } 7 | -------------------------------------------------------------------------------- /epi/minimum_distance_3_sorted_arrays/solution.go: -------------------------------------------------------------------------------- 1 | package minimum_distance_3_sorted_arrays 2 | 3 | func FindMinDistanceSortedArrays(sortedArrays [][]int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/minimum_points_covering_intervals/interval.go: -------------------------------------------------------------------------------- 1 | package minimum_points_covering_intervals 2 | 3 | type Interval struct { 4 | Left int 5 | Right int 6 | } 7 | -------------------------------------------------------------------------------- /epi/minimum_points_covering_intervals/solution.go: -------------------------------------------------------------------------------- 1 | package minimum_points_covering_intervals 2 | 3 | func FindMinimumVisits(intervals []Interval) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/minimum_waiting_time/main_test.go: -------------------------------------------------------------------------------- 1 | package minimum_waiting_time_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/minimum_waiting_time/solution.go: -------------------------------------------------------------------------------- 1 | package minimum_waiting_time 2 | 3 | func MinimumTotalWaitingTime(serviceTimes []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/minimum_weight_path_in_a_triangle/solution.go: -------------------------------------------------------------------------------- 1 | package minimum_weight_path_in_a_triangle 2 | 3 | func MinimumPathTotal(triangle [][]int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/n_queens/main_test.go: -------------------------------------------------------------------------------- 1 | package n_queens_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/n_queens/solution.go: -------------------------------------------------------------------------------- 1 | package n_queens 2 | 3 | func NQueens(n int) [][]int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/nearest_repeated_entries/main_test.go: -------------------------------------------------------------------------------- 1 | package nearest_repeated_entries_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/nearest_repeated_entries/solution.go: -------------------------------------------------------------------------------- 1 | package nearest_repeated_entries 2 | 3 | func FindNearestRepetition(paragraph []string) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/next_permutation/main_test.go: -------------------------------------------------------------------------------- 1 | package next_permutation_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/next_permutation/solution.go: -------------------------------------------------------------------------------- 1 | package next_permutation 2 | 3 | func NextPermutation(perm []int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/nonuniform_random_number/main_test.go: -------------------------------------------------------------------------------- 1 | package nonuniform_random_number_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/nonuniform_random_number/solution.go: -------------------------------------------------------------------------------- 1 | package nonuniform_random_number 2 | 3 | func NonuniformRandomNumberGeneration(values []int, probabilities []float64) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/number_of_score_combinations/main_test.go: -------------------------------------------------------------------------------- 1 | package number_of_score_combinations_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/number_of_score_combinations/solution.go: -------------------------------------------------------------------------------- 1 | package number_of_score_combinations 2 | 3 | func NumCombinationsForFinalScore(finalScore int, individualPlayScores []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/number_of_traversals_matrix/main_test.go: -------------------------------------------------------------------------------- 1 | package number_of_traversals_matrix_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/number_of_traversals_matrix/solution.go: -------------------------------------------------------------------------------- 1 | package number_of_traversals_matrix 2 | 3 | func NumberOfWays(n int, m int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/number_of_traversals_staircase/main_test.go: -------------------------------------------------------------------------------- 1 | package number_of_traversals_staircase_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/number_of_traversals_staircase/solution.go: -------------------------------------------------------------------------------- 1 | package number_of_traversals_staircase 2 | 3 | func NumberOfWaysToTop(top int, maximumStep int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/offline_sampling/main_test.go: -------------------------------------------------------------------------------- 1 | package offline_sampling_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/offline_sampling/solution.go: -------------------------------------------------------------------------------- 1 | package offline_sampling 2 | 3 | func RandomSampling(k int, a []int) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/online_median/main_test.go: -------------------------------------------------------------------------------- 1 | package online_median_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/online_median/solution.go: -------------------------------------------------------------------------------- 1 | package online_median 2 | 3 | func OnlineMedian(sequence <-chan int) []float64 { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/online_sampling/main_test.go: -------------------------------------------------------------------------------- 1 | package online_sampling_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/online_sampling/solution.go: -------------------------------------------------------------------------------- 1 | package online_sampling 2 | 3 | func OnlineRandomSample(stream <-chan int, k int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/parity/main_test.go: -------------------------------------------------------------------------------- 1 | package parity_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/parity/solution.go: -------------------------------------------------------------------------------- 1 | package parity 2 | 3 | func Parity(x int64) int16 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/pascal_triangle/main_test.go: -------------------------------------------------------------------------------- 1 | package pascal_triangle_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/pascal_triangle/solution.go: -------------------------------------------------------------------------------- 1 | package pascal_triangle 2 | 3 | func GeneratePascalTriangle(numRows int) [][]int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/path_sum/main_test.go: -------------------------------------------------------------------------------- 1 | package path_sum_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/path_sum/solution.go: -------------------------------------------------------------------------------- 1 | package path_sum 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func HasPathSum(t *tree.BinaryTreeNode, remainingWeight int) bool { 8 | // TODO - Add your code here 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /epi/permutations/main_test.go: -------------------------------------------------------------------------------- 1 | package permutations_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/permutations/solution.go: -------------------------------------------------------------------------------- 1 | package permutations 2 | 3 | func Permutations(a []int) [][]int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/phone_number_mnemonic/main_test.go: -------------------------------------------------------------------------------- 1 | package phone_number_mnemonic_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/phone_number_mnemonic/solution.go: -------------------------------------------------------------------------------- 1 | package phone_number_mnemonic 2 | 3 | func PhoneMnemonic(phoneNumber string) []string { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/picking_up_coins/main_test.go: -------------------------------------------------------------------------------- 1 | package picking_up_coins_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/picking_up_coins/solution.go: -------------------------------------------------------------------------------- 1 | package picking_up_coins 2 | 3 | func PickUpCoins(coins []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/pivot_list/main_test.go: -------------------------------------------------------------------------------- 1 | package pivot_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/pivot_list/solution.go: -------------------------------------------------------------------------------- 1 | package pivot_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func ListPivoting(l *list.Node, x int) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/power_set/main_test.go: -------------------------------------------------------------------------------- 1 | package power_set_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/power_set/solution.go: -------------------------------------------------------------------------------- 1 | package power_set 2 | 3 | func GeneratePowerSet(inputSet []int) [][]int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/power_xy/main_test.go: -------------------------------------------------------------------------------- 1 | package power_xy_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/power_xy/solution.go: -------------------------------------------------------------------------------- 1 | package power_xy 2 | 3 | func Power(x float64, y int) float64 { 4 | // TODO - Add your code here 5 | return 0.0 6 | } 7 | -------------------------------------------------------------------------------- /epi/pretty_printing/main_test.go: -------------------------------------------------------------------------------- 1 | package pretty_printing_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/pretty_printing/solution.go: -------------------------------------------------------------------------------- 1 | package pretty_printing 2 | 3 | func MinimumMessiness(words []string, lineLength int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/prime_sieve/main_test.go: -------------------------------------------------------------------------------- 1 | package prime_sieve_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/prime_sieve/solution.go: -------------------------------------------------------------------------------- 1 | package prime_sieve 2 | 3 | func GeneratePrimes(n int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/primitive_divide/main_test.go: -------------------------------------------------------------------------------- 1 | package primitive_divide_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/primitive_divide/solution.go: -------------------------------------------------------------------------------- 1 | package primitive_divide 2 | 3 | func Divide(x int, y int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/primitive_multiply/main_test.go: -------------------------------------------------------------------------------- 1 | package primitive_multiply_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/primitive_multiply/solution.go: -------------------------------------------------------------------------------- 1 | package primitive_multiply 2 | 3 | func PrimitiveMultiply(x int64, y int64) int64 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/queue_from_stacks/main_test.go: -------------------------------------------------------------------------------- 1 | package queue_from_stacks_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/queue_from_stacks/solution.go: -------------------------------------------------------------------------------- 1 | package queue_from_stacks 2 | 3 | type Solution interface { 4 | Enqueue(x int) 5 | Dequeue() int 6 | } 7 | 8 | type QueueFromStacks struct { 9 | // TODO - Add your code here 10 | } 11 | 12 | func NewQueueFromStacks() Solution { 13 | // TODO - Add your code here 14 | return &QueueFromStacks{} 15 | } 16 | 17 | func (q *QueueFromStacks) Enqueue(x int) { 18 | // TODO - Add your code here 19 | } 20 | 21 | func (q *QueueFromStacks) Dequeue() int { 22 | // TODO - Add your code here 23 | return 0 24 | } 25 | -------------------------------------------------------------------------------- /epi/queue_with_max/main_test.go: -------------------------------------------------------------------------------- 1 | package queue_with_max_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/random_permutation/main_test.go: -------------------------------------------------------------------------------- 1 | package random_permutation_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/random_permutation/solution.go: -------------------------------------------------------------------------------- 1 | package random_permutation 2 | 3 | func ComputeRandomPermutation(n int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/random_subset/main_test.go: -------------------------------------------------------------------------------- 1 | package random_subset_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/random_subset/solution.go: -------------------------------------------------------------------------------- 1 | package random_subset 2 | 3 | func RandomSubset(n int, k int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/range_lookup_in_bst/interval.go: -------------------------------------------------------------------------------- 1 | package range_lookup_in_bst 2 | 3 | type Interval struct { 4 | Left int 5 | Right int 6 | } 7 | -------------------------------------------------------------------------------- /epi/range_lookup_in_bst/main_test.go: -------------------------------------------------------------------------------- 1 | package range_lookup_in_bst_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/range_lookup_in_bst/solution.go: -------------------------------------------------------------------------------- 1 | package range_lookup_in_bst 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func RangeLookupInBst(t *tree.BSTNode, interval Interval) []int { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/real_square_root/main_test.go: -------------------------------------------------------------------------------- 1 | package real_square_root_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/real_square_root/solution.go: -------------------------------------------------------------------------------- 1 | package real_square_root 2 | 3 | func SquareRootReal(x float64) float64 { 4 | // TODO - Add your code here 5 | return 0.0 6 | } 7 | -------------------------------------------------------------------------------- /epi/rectangle_intersection/main_test.go: -------------------------------------------------------------------------------- 1 | package rectangle_intersection_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/rectangle_intersection/rect.go: -------------------------------------------------------------------------------- 1 | package rectangle_intersection 2 | 3 | type Rect struct { 4 | X int 5 | Y int 6 | Width int 7 | Height int 8 | } 9 | -------------------------------------------------------------------------------- /epi/rectangle_intersection/solution.go: -------------------------------------------------------------------------------- 1 | package rectangle_intersection 2 | 3 | func IntersectRectangle(r1 Rect, r2 Rect) Rect { 4 | // TODO - Add your code here 5 | return Rect{} 6 | } 7 | -------------------------------------------------------------------------------- /epi/refueling_schedule/main_test.go: -------------------------------------------------------------------------------- 1 | package refueling_schedule_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/refueling_schedule/solution.go: -------------------------------------------------------------------------------- 1 | package refueling_schedule 2 | 3 | const MPG int = 20 4 | 5 | func FindAmpleCity(gallons []int, distances []int) int { 6 | // TODO - Add your code here 7 | return 0 8 | } 9 | -------------------------------------------------------------------------------- /epi/regular_expression/main_test.go: -------------------------------------------------------------------------------- 1 | package regular_expression_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/regular_expression/solution.go: -------------------------------------------------------------------------------- 1 | package regular_expression 2 | 3 | func IsMatch(regex string, s string) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/remove_duplicates/main_test.go: -------------------------------------------------------------------------------- 1 | package remove_duplicates_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/remove_duplicates/name.go: -------------------------------------------------------------------------------- 1 | package remove_duplicates 2 | 3 | type Name struct { 4 | FirstName string 5 | LastName string 6 | } 7 | -------------------------------------------------------------------------------- /epi/remove_duplicates/solution.go: -------------------------------------------------------------------------------- 1 | package remove_duplicates 2 | 3 | func EliminateDuplicate(names *[]Name) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/remove_duplicates_from_sorted_list/solution.go: -------------------------------------------------------------------------------- 1 | package remove_duplicates_from_sorted_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func RemoveDuplicates(l *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/replace_and_remove/main_test.go: -------------------------------------------------------------------------------- 1 | package replace_and_remove_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/replace_and_remove/solution.go: -------------------------------------------------------------------------------- 1 | package replace_and_remove 2 | 3 | func ReplaceAndRemove(size int, s []rune) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/reverse_bits/main_test.go: -------------------------------------------------------------------------------- 1 | package reverse_bits_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/reverse_bits/solution.go: -------------------------------------------------------------------------------- 1 | package reverse_bits 2 | 3 | func ReverseBits(x int64) int64 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/reverse_digits/main_test.go: -------------------------------------------------------------------------------- 1 | package reverse_digits_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/reverse_digits/solution.go: -------------------------------------------------------------------------------- 1 | package reverse_digits 2 | 3 | func Reverse(x int) int64 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/reverse_sublist/main_test.go: -------------------------------------------------------------------------------- 1 | package reverse_sublist_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/reverse_sublist/solution.go: -------------------------------------------------------------------------------- 1 | package reverse_sublist 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func ReverseSublist(l *list.Node, start int, finish int) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/reverse_words/main_test.go: -------------------------------------------------------------------------------- 1 | package reverse_words_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/reverse_words/solution.go: -------------------------------------------------------------------------------- 1 | package reverse_words 2 | 3 | func ReverseWords(input []rune) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/road_network/highway_section.go: -------------------------------------------------------------------------------- 1 | package road_network 2 | 3 | type HighwaySection struct { 4 | X int 5 | Y int 6 | Distance int 7 | } 8 | -------------------------------------------------------------------------------- /epi/road_network/main_test.go: -------------------------------------------------------------------------------- 1 | package road_network_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/road_network/solution.go: -------------------------------------------------------------------------------- 1 | package road_network 2 | 3 | func FindBestProposals(h []HighwaySection, p []HighwaySection, n int) HighwaySection { 4 | // TODO - Add your code here 5 | return HighwaySection{} 6 | } 7 | -------------------------------------------------------------------------------- /epi/roman_to_integer/main_test.go: -------------------------------------------------------------------------------- 1 | package roman_to_integer_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/roman_to_integer/solution.go: -------------------------------------------------------------------------------- 1 | package roman_to_integer 2 | 3 | func RomanToInteger(s string) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/rook_attack/main_test.go: -------------------------------------------------------------------------------- 1 | package rook_attack_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/rook_attack/solution.go: -------------------------------------------------------------------------------- 1 | package rook_attack 2 | 3 | func RookAttack(a [][]int) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/rotate_array/main_test.go: -------------------------------------------------------------------------------- 1 | package rotate_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/rotate_array/solution.go: -------------------------------------------------------------------------------- 1 | package rotate_array 2 | 3 | func RotateArray(rotateAmount int, a []int) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/run_length_compression/main_test.go: -------------------------------------------------------------------------------- 1 | package run_length_compression_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/run_length_compression/solution.go: -------------------------------------------------------------------------------- 1 | package run_length_compression 2 | 3 | type RLCompression struct{} 4 | 5 | func (r *RLCompression) Decoding(s string) string { 6 | // TODO - Add your code here 7 | return "" 8 | } 9 | 10 | func (r *RLCompression) Encoding(s string) string { 11 | // TODO - Add your code here 12 | return "" 13 | } 14 | -------------------------------------------------------------------------------- /epi/search_entry_equal_to_index/main_test.go: -------------------------------------------------------------------------------- 1 | package search_entry_equal_to_index_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_entry_equal_to_index/solution.go: -------------------------------------------------------------------------------- 1 | package search_entry_equal_to_index 2 | 3 | func SearchEntryEqualToItsIndex(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_first_greater_value_in_bst/solution.go: -------------------------------------------------------------------------------- 1 | package search_first_greater_value_in_bst 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func FindFirstGreaterThanK(t *tree.BSTNode, k int) *tree.BSTNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/search_first_key/main_test.go: -------------------------------------------------------------------------------- 1 | package search_first_key_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_first_key/solution.go: -------------------------------------------------------------------------------- 1 | package search_first_key 2 | 3 | func SearchFirstOfK(a []int, k int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_for_min_max_in_array/main_test.go: -------------------------------------------------------------------------------- 1 | package search_for_min_max_in_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_for_min_max_in_array/solution.go: -------------------------------------------------------------------------------- 1 | package search_for_min_max_in_array 2 | 3 | func FindMinMax(a []int) (min, max int) { 4 | // TODO - Add your code here 5 | return 0, 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_for_missing_element/main_test.go: -------------------------------------------------------------------------------- 1 | package search_for_missing_element_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_for_missing_element/solution.go: -------------------------------------------------------------------------------- 1 | package search_for_missing_element 2 | 3 | func FindDuplicateMissing(a []int) (duplicate, missing int) { 4 | // TODO - Add your code here 5 | return 0, 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_frequent_items/main_test.go: -------------------------------------------------------------------------------- 1 | package search_frequent_items_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_frequent_items/solution.go: -------------------------------------------------------------------------------- 1 | package search_frequent_items 2 | 3 | func SearchFrequentItems(k int, stream <-chan string) []string { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_in_bst/main_test.go: -------------------------------------------------------------------------------- 1 | package search_in_bst_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_in_bst/solution.go: -------------------------------------------------------------------------------- 1 | package search_in_bst 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func SearchBST(t *tree.BSTNode, key int) *tree.BSTNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/search_in_list/main_test.go: -------------------------------------------------------------------------------- 1 | package search_in_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_in_list/solution.go: -------------------------------------------------------------------------------- 1 | package search_in_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func SearchList(l *list.Node, key int) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/search_maze/color.go: -------------------------------------------------------------------------------- 1 | package search_maze 2 | 3 | type Color int 4 | 5 | const ( 6 | White Color = iota 7 | Black 8 | ) 9 | -------------------------------------------------------------------------------- /epi/search_maze/coordinate.go: -------------------------------------------------------------------------------- 1 | package search_maze 2 | 3 | type Coordinate struct { 4 | X int 5 | Y int 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_maze/main_test.go: -------------------------------------------------------------------------------- 1 | package search_maze_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_maze/solution.go: -------------------------------------------------------------------------------- 1 | package search_maze 2 | 3 | func SearchMaze(maze [][]Color, s Coordinate, e Coordinate) []Coordinate { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_row_col_sorted_matrix/main_test.go: -------------------------------------------------------------------------------- 1 | package search_row_col_sorted_matrix_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_row_col_sorted_matrix/solution.go: -------------------------------------------------------------------------------- 1 | package search_row_col_sorted_matrix 2 | 3 | func MatrixSearch(a [][]int, x int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_shifted_sorted_array/main_test.go: -------------------------------------------------------------------------------- 1 | package search_shifted_sorted_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_shifted_sorted_array/solution.go: -------------------------------------------------------------------------------- 1 | package search_shifted_sorted_array 2 | 3 | func SearchSmallest(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/search_unknown_length_array/array_unknown_length.go: -------------------------------------------------------------------------------- 1 | package search_unknown_length_array 2 | 3 | type ArrayUnknownLength interface { 4 | // Get returns the value at the given index in the array, if the index is valid. 5 | // In this case the valid flag will be true. 6 | // In case the index is out of bounds, it returns valid = false and an unspecified value. 7 | Get(index int) (value int, valid bool) 8 | } 9 | -------------------------------------------------------------------------------- /epi/search_unknown_length_array/main_test.go: -------------------------------------------------------------------------------- 1 | package search_unknown_length_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/search_unknown_length_array/solution.go: -------------------------------------------------------------------------------- 1 | package search_unknown_length_array 2 | 3 | func BinarySearchUnknownLength(a ArrayUnknownLength, k int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/smallest_nonconstructible_value/solution.go: -------------------------------------------------------------------------------- 1 | package smallest_nonconstructible_value 2 | 3 | func SmallestNonconstructibleValue(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/smallest_subarray_covering_all_values/solution.go: -------------------------------------------------------------------------------- 1 | package smallest_subarray_covering_all_values 2 | 3 | func FindSmallestSequentiallyCoveringSubset(paragraph, keywords []string) (start, end int) { 4 | // TODO - Add your code here 5 | return 0, 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/smallest_subarray_covering_set/main_test.go: -------------------------------------------------------------------------------- 1 | package smallest_subarray_covering_set_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/smallest_subarray_covering_set/solution.go: -------------------------------------------------------------------------------- 1 | package smallest_subarray_covering_set 2 | 3 | func FindSmallestSubarrayCoveringSet(paragraph []string, keywords map[string]struct{}) (start, end int) { 4 | // TODO - Add your code here 5 | return 0, 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/snake_string/main_test.go: -------------------------------------------------------------------------------- 1 | package snake_string_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/snake_string/solution.go: -------------------------------------------------------------------------------- 1 | package snake_string 2 | 3 | func SnakeString(s string) string { 4 | // TODO - Add your code here 5 | return "" 6 | } 7 | -------------------------------------------------------------------------------- /epi/sort_almost_sorted_array/main_test.go: -------------------------------------------------------------------------------- 1 | package sort_almost_sorted_array_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sort_almost_sorted_array/solution.go: -------------------------------------------------------------------------------- 1 | package sort_almost_sorted_array 2 | 3 | func SortApproximatelySortedData(sequence <-chan int, k int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/sort_increasing_decreasing_array/solution.go: -------------------------------------------------------------------------------- 1 | package sort_increasing_decreasing_array 2 | 3 | func SortKIncreasingDecreasingArray(a []int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/sort_list/main_test.go: -------------------------------------------------------------------------------- 1 | package sort_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sort_list/solution.go: -------------------------------------------------------------------------------- 1 | package sort_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func StableSortList(l *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/sorted_array_remove_dups/main_test.go: -------------------------------------------------------------------------------- 1 | package sorted_array_remove_dups_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sorted_array_remove_dups/solution.go: -------------------------------------------------------------------------------- 1 | package sorted_array_remove_dups 2 | 3 | func DeleteDuplicates(a []int) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/sorted_arrays_merge/main_test.go: -------------------------------------------------------------------------------- 1 | package sorted_arrays_merge_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sorted_arrays_merge/solution.go: -------------------------------------------------------------------------------- 1 | package sorted_arrays_merge 2 | 3 | func MergeSortedArrays(sortedArrays [][]int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/sorted_list_to_bst/main_test.go: -------------------------------------------------------------------------------- 1 | package sorted_list_to_bst_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sorted_list_to_bst/solution.go: -------------------------------------------------------------------------------- 1 | package sorted_list_to_bst 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func BuildBSTFromSortedList(l *list.DoublyLinkedNode, length int) *list.DoublyLinkedNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/sorted_lists_merge/main_test.go: -------------------------------------------------------------------------------- 1 | package sorted_lists_merge_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sorted_lists_merge/solution.go: -------------------------------------------------------------------------------- 1 | package sorted_lists_merge 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func MergeTwoSortedLists(l1 *list.Node, l2 *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/spiral_ordering/main_test.go: -------------------------------------------------------------------------------- 1 | package spiral_ordering_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/spiral_ordering/solution.go: -------------------------------------------------------------------------------- 1 | package spiral_ordering 2 | 3 | func MatrixInSpiralOrder(squareMatrix [][]int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/spreadsheet_encoding/main_test.go: -------------------------------------------------------------------------------- 1 | package spreadsheet_encoding_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/spreadsheet_encoding/solution.go: -------------------------------------------------------------------------------- 1 | package spreadsheet_encoding 2 | 3 | func SsDecodeColID(col string) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/stack_with_max/main_test.go: -------------------------------------------------------------------------------- 1 | package stack_with_max_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/string_decompositions_into_dictionary_words/solution.go: -------------------------------------------------------------------------------- 1 | package string_decompositions_into_dictionary_words 2 | 3 | func FindAllSubstrings(s string, words []string) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/string_integer_interconversion/main_test.go: -------------------------------------------------------------------------------- 1 | package string_integer_interconversion_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/string_integer_interconversion/solution.go: -------------------------------------------------------------------------------- 1 | package string_integer_interconversion 2 | 3 | type StringIntegerConverter struct{} 4 | 5 | func (c StringIntegerConverter) IntToString(x int) string { 6 | // TODO - Add your code here 7 | return "" 8 | } 9 | 10 | func (c StringIntegerConverter) StringToInt(s string) int { 11 | // TODO - Add your code here 12 | return 0 13 | } 14 | -------------------------------------------------------------------------------- /epi/string_transformability/main_test.go: -------------------------------------------------------------------------------- 1 | package string_transformability_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/string_transformability/solution.go: -------------------------------------------------------------------------------- 1 | package string_transformability 2 | 3 | func TransformString(d map[string]struct{}, s string, t string) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/substring_match/main_test.go: -------------------------------------------------------------------------------- 1 | package substring_match_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/substring_match/solution.go: -------------------------------------------------------------------------------- 1 | package substring_match 2 | 3 | func RabinKarp(t string, s string) int { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/successor_in_tree/main_test.go: -------------------------------------------------------------------------------- 1 | package successor_in_tree_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/successor_in_tree/solution.go: -------------------------------------------------------------------------------- 1 | package successor_in_tree 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func FindSuccessor(node *tree.BinaryTree) *tree.BinaryTree { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/sudoku_solve/main_test.go: -------------------------------------------------------------------------------- 1 | package sudoku_solve_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sudoku_solve/solution.go: -------------------------------------------------------------------------------- 1 | package sudoku_solve 2 | 3 | const EmptyEntry = 0 4 | 5 | func SolveSudoku(partialAssignment [][]int) bool { 6 | // TODO - Add your code here 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /epi/sum_root_to_leaf/main_test.go: -------------------------------------------------------------------------------- 1 | package sum_root_to_leaf_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sum_root_to_leaf/solution.go: -------------------------------------------------------------------------------- 1 | package sum_root_to_leaf 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func SumRootToLeaf(t *tree.BinaryTreeNode) int { 8 | // TODO - Add your code here 9 | return 0 10 | } 11 | -------------------------------------------------------------------------------- /epi/sunset_view/main_test.go: -------------------------------------------------------------------------------- 1 | package sunset_view_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/sunset_view/solution.go: -------------------------------------------------------------------------------- 1 | package sunset_view 2 | 3 | func ExamineBuildingsWithSunset(sequence <-chan int) []int { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/swap_bits/main_test.go: -------------------------------------------------------------------------------- 1 | package swap_bits_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/swap_bits/solution.go: -------------------------------------------------------------------------------- 1 | package swap_bits 2 | 3 | func SwapBits(x int64, i int, j int) int64 { 4 | // TODO - Add your code here 5 | return 0 6 | } 7 | -------------------------------------------------------------------------------- /epi/task_pairing/main_test.go: -------------------------------------------------------------------------------- 1 | package task_pairing_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/task_pairing/solution.go: -------------------------------------------------------------------------------- 1 | package task_pairing 2 | 3 | type Task = int 4 | 5 | func OptimumTaskAssignment(taskDurations []Task) [][2]Task { 6 | // TODO - Add your code here 7 | return nil 8 | } 9 | -------------------------------------------------------------------------------- /epi/three_sum/main_test.go: -------------------------------------------------------------------------------- 1 | package three_sum_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/three_sum/solution.go: -------------------------------------------------------------------------------- 1 | package three_sum 2 | 3 | func HasThreeSum(a []int, t int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/tree_connect_leaves/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_connect_leaves_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_connect_leaves/solution.go: -------------------------------------------------------------------------------- 1 | package tree_connect_leaves 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func CreateListOfLeaves(t *tree.BinaryTreeNode) []*tree.BinaryTreeNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/tree_exterior/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_exterior_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_exterior/solution.go: -------------------------------------------------------------------------------- 1 | package tree_exterior 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func ExteriorBinaryTree(t *tree.BinaryTreeNode) []*tree.BinaryTreeNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/tree_from_preorder_inorder/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_from_preorder_inorder_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_from_preorder_inorder/solution.go: -------------------------------------------------------------------------------- 1 | package tree_from_preorder_inorder 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func BinaryTreeFromPreorderInorder(preorder []int, inorder []int) *tree.BinaryTreeNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/tree_from_preorder_with_null/int_or_null.go: -------------------------------------------------------------------------------- 1 | package tree_from_preorder_with_null 2 | 3 | // IntOrNull represents an integer value that can be nil. 4 | // The value is null if the `Valid` field is false. Otherwise the value is represented 5 | // by the integer value fro the `Value` field. 6 | type IntOrNull struct { 7 | Value int 8 | Valid bool 9 | } 10 | -------------------------------------------------------------------------------- /epi/tree_from_preorder_with_null/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_from_preorder_with_null_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_from_preorder_with_null/solution.go: -------------------------------------------------------------------------------- 1 | package tree_from_preorder_with_null 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func ReconstructPreorder(preorder []IntOrNull) *tree.BinaryTreeNode { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/tree_inorder/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_inorder_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_inorder/solution.go: -------------------------------------------------------------------------------- 1 | package tree_inorder 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func InorderTraversal(t *tree.BinaryTreeNode) []int { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/tree_level_order/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_level_order_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_level_order/solution.go: -------------------------------------------------------------------------------- 1 | package tree_level_order 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func BinaryTreeDepthOrder(t *tree.BinaryTreeNode) [][]int { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/tree_postorder/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_postorder_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_postorder/solution.go: -------------------------------------------------------------------------------- 1 | package tree_postorder 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func PostorderTraversal(t *tree.BinaryTreeNode) []int { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/tree_preorder/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_preorder_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_preorder/solution.go: -------------------------------------------------------------------------------- 1 | package tree_preorder 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func PreorderTraversal(t *tree.BinaryTreeNode) []int { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/tree_right_sibling/binary_tree_node_with_next.go: -------------------------------------------------------------------------------- 1 | package tree_right_sibling 2 | 3 | type BinaryTreeNodeWithNext struct { 4 | Data int 5 | Left, Right *BinaryTreeNodeWithNext 6 | Next *BinaryTreeNodeWithNext 7 | } 8 | -------------------------------------------------------------------------------- /epi/tree_right_sibling/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_right_sibling_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_right_sibling/solution.go: -------------------------------------------------------------------------------- 1 | package tree_right_sibling 2 | 3 | func ConstructRightSibling(tree *BinaryTreeNodeWithNext) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/tree_with_parent_inorder/main_test.go: -------------------------------------------------------------------------------- 1 | package tree_with_parent_inorder_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/tree_with_parent_inorder/solution.go: -------------------------------------------------------------------------------- 1 | package tree_with_parent_inorder 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/tree" 5 | ) 6 | 7 | func InorderTraversalWithParent(t *tree.BinaryTree) []int { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /epi/two_sorted_arrays_merge/main_test.go: -------------------------------------------------------------------------------- 1 | package two_sorted_arrays_merge_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/two_sorted_arrays_merge/solution.go: -------------------------------------------------------------------------------- 1 | package two_sorted_arrays_merge 2 | 3 | func MergeTwoSortedArrays(a []int, m int, b []int, n int) { 4 | // TODO - Add your code here 5 | } 6 | -------------------------------------------------------------------------------- /epi/two_sum/main_test.go: -------------------------------------------------------------------------------- 1 | package two_sum_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | 27 | os.Exit(code) 28 | } 29 | -------------------------------------------------------------------------------- /epi/two_sum/solution.go: -------------------------------------------------------------------------------- 1 | package two_sum 2 | 3 | func HasTwoSum(a []int, t int) bool { 4 | // TODO - Add your code here 5 | return false 6 | } 7 | -------------------------------------------------------------------------------- /epi/uniform_random_number/main_test.go: -------------------------------------------------------------------------------- 1 | package uniform_random_number_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/uniform_random_number/solution.go: -------------------------------------------------------------------------------- 1 | package uniform_random_number 2 | 3 | import "math/rand" 4 | 5 | func zeroOneRandom() int { 6 | return rand.Intn(2) 7 | } 8 | 9 | func UniformRandom(lowerBound int, upperBound int) int { 10 | // TODO - Add your code here 11 | return 0 12 | } 13 | -------------------------------------------------------------------------------- /epi/valid_ip_addresses/main_test.go: -------------------------------------------------------------------------------- 1 | package valid_ip_addresses_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/valid_ip_addresses/solution.go: -------------------------------------------------------------------------------- 1 | package valid_ip_addresses 2 | 3 | func GetValidIpAddress(s string) []string { 4 | // TODO - Add your code here 5 | return nil 6 | } 7 | -------------------------------------------------------------------------------- /epi/zip_list/main_test.go: -------------------------------------------------------------------------------- 1 | package zip_list_test 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "testing" 7 | 8 | progress "github.com/stefantds/go-epi-judge/progress/lib" 9 | "github.com/stefantds/go-epi-judge/test_utils/config" 10 | ) 11 | 12 | var cfg *config.Config 13 | 14 | func TestMain(m *testing.M) { 15 | var err error 16 | cfg, err = config.Parse() 17 | if err != nil { 18 | panic(err) 19 | } 20 | 21 | code := m.Run() 22 | 23 | if err = progress.PersistResult(code); err != nil { 24 | log.Print(err) 25 | } 26 | os.Exit(code) 27 | } 28 | -------------------------------------------------------------------------------- /epi/zip_list/solution.go: -------------------------------------------------------------------------------- 1 | package zip_list 2 | 3 | import ( 4 | "github.com/stefantds/go-epi-judge/data_structures/list" 5 | ) 6 | 7 | func ZippingLinkedList(l *list.Node) *list.Node { 8 | // TODO - Add your code here 9 | return nil 10 | } 11 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/stefantds/go-epi-judge 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/olekukonko/tablewriter v0.0.5-0.20201029120751-42e21c7531a3 7 | github.com/rogpeppe/go-internal v1.6.2 8 | github.com/stefantds/csvdecoder v0.2.0 9 | gopkg.in/yaml.v2 v2.2.8 10 | ) 11 | -------------------------------------------------------------------------------- /test_utils/fmt.go: -------------------------------------------------------------------------------- 1 | package test_utils 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | func MatrixFormatter(value interface{}) MatrixFmt { 9 | return MatrixFmt{ 10 | Val: value, 11 | } 12 | } 13 | 14 | // MatrixFmt represents a 2D matrix that can be pretty printed 15 | type MatrixFmt struct { 16 | Val interface{} 17 | } 18 | 19 | func (m MatrixFmt) String() string { 20 | s := fmt.Sprintf("%v", m.Val) 21 | s = strings.ReplaceAll(s, "[[", "") 22 | s = strings.ReplaceAll(s, "]]", "") 23 | s = strings.ReplaceAll(s, "] [", "\n") 24 | return s 25 | } 26 | -------------------------------------------------------------------------------- /test_utils/stats/retries.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | const numRuns = 5 4 | 5 | func RunFuncWithRetries(functionToCall func() bool, failureErr error) error { 6 | for i := 0; i < numRuns; i++ { 7 | if functionToCall() { 8 | return nil 9 | } 10 | } 11 | 12 | return failureErr 13 | } 14 | --------------------------------------------------------------------------------