From 80f9525b024fa78e06cf9d3138be338a4f578966 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Tue, 31 May 2022 18:26:02 +0300 Subject: [PATCH] Updated readmes. --- .../s0023_merge_k_sorted_lists/readme.md | 4 ++-- .../g0001_0100/s0037_sudoku_solver/readme.md | 2 +- .../g0001_0100/s0048_rotate_image/readme.md | 8 +++---- .../g0001_0100/s0054_spiral_matrix/readme.md | 4 ++-- .../s0056_merge_intervals/readme.md | 4 ++-- .../s0057_insert_interval/readme.md | 8 +++---- .../s0063_unique_paths_ii/readme.md | 4 ++-- .../s0064_minimum_path_sum/readme.md | 4 ++-- .../s0073_set_matrix_zeroes/readme.md | 4 ++-- .../s0074_search_a_2d_matrix/readme.md | 4 ++-- .../g0001_0100/s0079_word_search/readme.md | 6 ++--- .../s0085_maximal_rectangle/readme.md | 8 +++---- .../java/g0101_0200/s0120_triangle/readme.md | 4 ++-- .../s0130_surrounded_regions/readme.md | 4 ++-- .../g0101_0200/s0133_clone_graph/readme.md | 6 ++--- .../readme.md | 6 ++--- .../s0149_max_points_on_a_line/readme.md | 4 ++-- .../g0101_0200/s0174_dungeon_game/readme.md | 4 ++-- .../s0207_course_schedule/readme.md | 4 ++-- .../s0210_course_schedule_ii/readme.md | 4 ++-- .../g0201_0300/s0212_word_search_ii/readme.md | 4 ++-- .../s0218_the_skyline_problem/readme.md | 4 ++-- .../g0201_0300/s0221_maximal_square/readme.md | 6 ++--- .../s0240_search_a_2d_matrix_ii/readme.md | 4 ++-- .../g0201_0300/s0289_game_of_life/readme.md | 4 ++-- .../s0310_minimum_height_trees/readme.md | 4 ++-- .../readme.md | 6 ++--- .../s0332_reconstruct_itinerary/readme.md | 4 ++-- .../readme.md | 2 +- .../s0354_russian_doll_envelopes/readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../s0391_perfect_rectangle/readme.md | 8 +++---- .../s0399_evaluate_division/readme.md | 6 ++--- .../readme.md | 4 ++-- .../s0407_trapping_rain_water_ii/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s0419_battleships_in_a_board/readme.md | 4 ++-- .../s0427_construct_quad_tree/readme.md | 4 ++-- .../s0435_non_overlapping_intervals/readme.md | 6 ++--- .../s0436_find_right_interval/readme.md | 6 ++--- .../readme.md | 6 ++--- .../s0463_island_perimeter/readme.md | 6 ++--- .../s0498_diagonal_traverse/readme.md | 4 ++-- .../g0501_0600/s0529_minesweeper/readme.md | 4 ++-- .../java/g0501_0600/s0542_01_matrix/readme.md | 4 ++-- .../s0547_number_of_provinces/readme.md | 4 ++-- .../g0501_0600/s0554_brick_wall/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s0566_reshape_the_matrix/readme.md | 4 ++-- .../s0587_erect_the_fence/readme.md | 4 ++-- .../s0598_range_addition_ii/readme.md | 4 ++-- .../s0630_course_schedule_iii/readme.md | 6 ++--- .../readme.md | 4 ++-- .../s0638_shopping_offers/readme.md | 4 ++-- .../readme.md | 4 ++-- .../g0601_0700/s0661_image_smoother/readme.md | 4 ++-- .../s0672_bulb_switcher_ii/readme.md | 18 +++++++------- .../readme.md | 6 ++--- .../s0684_redundant_connection/readme.md | 4 ++-- .../s0685_redundant_connection_ii/readme.md | 4 ++-- .../s0690_employee_importance/readme.md | 4 ++-- .../s0695_max_area_of_island/readme.md | 4 ++-- .../s0699_falling_squares/readme.md | 4 ++-- .../g0701_0800/s0733_flood_fill/readme.md | 4 ++-- .../g0701_0800/s0741_cherry_pickup/readme.md | 4 ++-- .../s0743_network_delay_time/readme.md | 6 ++--- .../g0701_0800/s0749_contain_virus/readme.md | 6 ++--- .../readme.md | 4 ++-- .../s0764_largest_plus_sign/readme.md | 4 ++-- .../s0766_toeplitz_matrix/readme.md | 4 ++-- .../g0701_0800/s0773_sliding_puzzle/readme.md | 6 ++--- .../s0778_swim_in_rising_water/readme.md | 4 ++-- .../s0782_transform_to_chessboard/readme.md | 6 ++--- .../s0785_is_graph_bipartite/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s0789_escape_the_ghosts/readme.md | 6 ++--- .../readme.md | 4 ++-- .../s0802_find_eventual_safe_states/readme.md | 4 ++-- .../s0803_bricks_falling_when_hit/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s0812_largest_triangle_area/readme.md | 4 ++-- .../g0801_0900/s0815_bus_routes/readme.md | 4 ++-- .../s0827_making_a_large_island/readme.md | 6 ++--- .../s0832_flipping_an_image/readme.md | 4 ++-- .../s0834_sum_of_distances_in_tree/readme.md | 4 ++-- .../g0801_0900/s0835_image_overlap/readme.md | 6 ++--- .../s0840_magic_squares_in_grid/readme.md | 4 ++-- .../g0801_0900/s0841_keys_and_rooms/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s0850_rectangle_area_ii/readme.md | 4 ++-- .../g0801_0900/s0851_loud_and_rich/readme.md | 2 +- .../readme.md | 4 ++-- .../s0867_transpose_matrix/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s0874_walking_robot_simulation/readme.md | 2 +- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../s0886_possible_bipartition/readme.md | 6 ++--- .../s0892_surface_area_of_3d_shapes/readme.md | 6 ++--- .../s0909_snakes_and_ladders/readme.md | 4 ++-- .../g0901_1000/s0913_cat_and_mouse/readme.md | 4 ++-- .../s0924_minimize_malware_spread/readme.md | 6 ++--- .../readme.md | 6 ++--- .../s0931_minimum_falling_path_sum/readme.md | 4 ++-- .../s0934_shortest_bridge/readme.md | 6 ++--- .../s0939_minimum_area_rectangle/readme.md | 4 ++-- .../readme.md | 6 ++--- .../s0963_minimum_area_rectangle_ii/readme.md | 6 ++--- .../readme.md | 4 ++-- .../s0980_unique_paths_iii/readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../s0994_rotting_oranges/readme.md | 6 ++--- .../s0997_find_the_town_judge/readme.md | 6 ++--- .../readme.md | 6 ++--- .../s1001_grid_illumination/readme.md | 6 ++--- .../s1020_number_of_enclaves/readme.md | 4 ++-- .../s1024_video_stitching/readme.md | 6 ++--- .../s1029_two_city_scheduling/readme.md | 6 ++--- .../s1034_coloring_a_border/readme.md | 6 ++--- .../s1036_escape_a_large_maze/readme.md | 2 +- .../s1037_valid_boomerang/readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../g1001_1100/s1094_car_pooling/readme.md | 4 ++-- .../s1105_filling_bookcase_shelves/readme.md | 4 ++-- .../s1109_corporate_flight_bookings/readme.md | 4 ++-- .../s1125_smallest_sufficient_team/readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1139_largest_1_bordered_square/readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1219_path_with_maximum_gold/readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 8 +++---- .../s1254_number_of_closed_islands/readme.md | 6 ++--- .../g1201_1300/s1260_shift_2d_grid/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../s1288_remove_covered_intervals/readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1310_xor_queries_of_a_subarray/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1314_matrix_block_sum/readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 2 +- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 2 +- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1380_lucky_numbers_in_a_matrix/readme.md | 6 ++--- .../s1386_cinema_seat_allocation/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../s1424_diagonal_traverse_ii/readme.md | 4 ++-- .../readme.md | 6 ++--- .../s1436_destination_city/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1462_course_schedule_iv/readme.md | 6 ++--- .../s1463_cherry_pickup_ii/readme.md | 4 ++-- .../readme.md | 6 ++--- .../s1473_paint_house_iii/readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1494_parallel_courses_ii/readme.md | 4 ++-- .../s1499_max_value_of_equation/readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 2 +- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1559_detect_cycles_in_2d_grid/readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1572_matrix_diagonal_sum/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1583_count_unhappy_friends/readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../s1591_strange_printer_ii/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../s1615_maximal_network_rank/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../s1631_path_with_minimum_effort/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../s1672_richest_customer_wealth/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1701_average_waiting_time/readme.md | 4 ++-- .../s1706_where_will_the_ball_fall/readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1710_maximum_units_on_a_truck/readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../s1765_map_of_highest_peak/readme.md | 4 ++-- .../s1766_tree_of_coprimes/readme.md | 4 ++-- .../readme.md | 4 ++-- .../g1701_1800/s1776_car_fleet_ii/readme.md | 4 ++-- .../readme.md | 6 ++--- .../s1782_count_pairs_of_nodes/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1791_find_center_of_star_graph/readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1834_single_threaded_cpu/readme.md | 4 ++-- .../s1840_maximum_building_height/readme.md | 4 ++-- .../g1801_1900/s1847_closest_room/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1854_maximum_population_year/readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1861_rotating_the_box/readme.md | 6 ++--- .../readme.md | 20 ++++++++-------- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1895_largest_magic_square/readme.md | 4 ++-- .../readme.md | 12 +++++----- .../s1901_find_a_peak_element_ii/readme.md | 4 ++-- .../s1905_count_sub_islands/readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 4 ++-- .../s1923_longest_common_subpath/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 10 ++++---- .../readme.md | 4 ++-- .../readme.md | 16 ++++++------- .../readme.md | 4 ++-- .../s1943_describe_the_painting/readme.md | 24 +++++++++---------- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 14 +++++------ .../s1958_check_if_move_is_legal/readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../s1975_maximum_matrix_sum/readme.md | 4 ++-- .../readme.md | 4 ++-- .../readme.md | 6 ++--- .../readme.md | 16 ++++++------- .../readme.md | 14 +++++------ .../readme.md | 6 ++--- .../readme.md | 22 ++++++++--------- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 14 +++++------ .../readme.md | 4 ++-- .../java/g2001_2100/s2017_grid_game/readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- .../readme.md | 16 ++++++------- .../readme.md | 4 ++-- .../s2050_parallel_courses_iii/readme.md | 4 ++-- .../readme.md | 6 ++--- .../s2055_plates_between_candles/readme.md | 4 ++-- .../readme.md | 7 +++--- .../readme.md | 10 ++++---- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 6 ++--- .../readme.md | 4 ++-- 310 files changed, 820 insertions(+), 819 deletions(-) diff --git a/src/main/java/g0001_0100/s0023_merge_k_sorted_lists/readme.md b/src/main/java/g0001_0100/s0023_merge_k_sorted_lists/readme.md index c12adecf..10c3e56c 100644 --- a/src/main/java/g0001_0100/s0023_merge_k_sorted_lists/readme.md +++ b/src/main/java/g0001_0100/s0023_merge_k_sorted_lists/readme.md @@ -8,7 +8,7 @@ _Merge all the linked-lists into one sorted linked-list and return it._ **Example 1:** -**Input:** lists = [[1,4,5],[1,3,4],[2,6]] +**Input:** lists = \[\[1,4,5],[1,3,4],[2,6]] **Output:** [1,1,2,3,4,4,5,6] @@ -22,7 +22,7 @@ _Merge all the linked-lists into one sorted linked-list and return it._ **Example 3:** -**Input:** lists = [[]] +**Input:** lists = \[\[]] **Output:** [] diff --git a/src/main/java/g0001_0100/s0037_sudoku_solver/readme.md b/src/main/java/g0001_0100/s0037_sudoku_solver/readme.md index ab00d07c..0a457294 100644 --- a/src/main/java/g0001_0100/s0037_sudoku_solver/readme.md +++ b/src/main/java/g0001_0100/s0037_sudoku_solver/readme.md @@ -18,7 +18,7 @@ The `'.'` character indicates empty cells. **Input:** - board = [["5","3",".",".","7",".",".",".","."], + board = [ ["5","3",".",".","7",".",".",".","."], ["6",".",".","1","9","5",".",".","."], [".","9","8",".",".",".",".","6","."], ["8",".",".",".","6",".",".",".","3"], diff --git a/src/main/java/g0001_0100/s0048_rotate_image/readme.md b/src/main/java/g0001_0100/s0048_rotate_image/readme.md index 389f8bd5..89dc1026 100644 --- a/src/main/java/g0001_0100/s0048_rotate_image/readme.md +++ b/src/main/java/g0001_0100/s0048_rotate_image/readme.md @@ -10,7 +10,7 @@ You have to rotate the image [**in-place**](https://en.wikipedia.org/wiki/In-pla ![](https://assets.leetcode.com/uploads/2020/08/28/mat1.jpg) -**Input:** matrix = [[1,2,3],[4,5,6],[7,8,9]] +**Input:** matrix = \[\[1,2,3],[4,5,6],[7,8,9]] **Output:** [[7,4,1],[8,5,2],[9,6,3]] @@ -18,19 +18,19 @@ You have to rotate the image [**in-place**](https://en.wikipedia.org/wiki/In-pla ![](https://assets.leetcode.com/uploads/2020/08/28/mat2.jpg) -**Input:** matrix = [[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]] +**Input:** matrix = \[\[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]] **Output:** [[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]] **Example 3:** -**Input:** matrix = [[1]] +**Input:** matrix = \[\[1]] **Output:** [[1]] **Example 4:** -**Input:** matrix = [[1,2],[3,4]] +**Input:** matrix = \[\[1,2],[3,4]] **Output:** [[3,1],[4,2]] diff --git a/src/main/java/g0001_0100/s0054_spiral_matrix/readme.md b/src/main/java/g0001_0100/s0054_spiral_matrix/readme.md index 3ba41c30..e73b4a3e 100644 --- a/src/main/java/g0001_0100/s0054_spiral_matrix/readme.md +++ b/src/main/java/g0001_0100/s0054_spiral_matrix/readme.md @@ -8,7 +8,7 @@ Given an `m x n` `matrix`, return _all elements of the_ `matrix` _in spiral orde ![](https://assets.leetcode.com/uploads/2020/11/13/spiral1.jpg) -**Input:** matrix = [[1,2,3],[4,5,6],[7,8,9]] +**Input:** matrix = \[\[1,2,3],[4,5,6],[7,8,9]] **Output:** [1,2,3,6,9,8,7,4,5] @@ -16,7 +16,7 @@ Given an `m x n` `matrix`, return _all elements of the_ `matrix` _in spiral orde ![](https://assets.leetcode.com/uploads/2020/11/13/spiral.jpg) -**Input:** matrix = [[1,2,3,4],[5,6,7,8],[9,10,11,12]] +**Input:** matrix = \[\[1,2,3,4],[5,6,7,8],[9,10,11,12]] **Output:** [1,2,3,4,8,12,11,10,9,5,6,7] diff --git a/src/main/java/g0001_0100/s0056_merge_intervals/readme.md b/src/main/java/g0001_0100/s0056_merge_intervals/readme.md index 948c4e94..3f54ed59 100644 --- a/src/main/java/g0001_0100/s0056_merge_intervals/readme.md +++ b/src/main/java/g0001_0100/s0056_merge_intervals/readme.md @@ -6,7 +6,7 @@ Given an array of `intervals` where intervals[i] = [starti, end **Example 1:** -**Input:** intervals = [[1,3],[2,6],[8,10],[15,18]] +**Input:** intervals = \[\[1,3],[2,6],[8,10],[15,18]] **Output:** [[1,6],[8,10],[15,18]] @@ -14,7 +14,7 @@ Given an array of `intervals` where intervals[i] = [starti, end **Example 2:** -**Input:** intervals = [[1,4],[4,5]] +**Input:** intervals = \[\[1,4],[4,5]] **Output:** [[1,5]] diff --git a/src/main/java/g0001_0100/s0057_insert_interval/readme.md b/src/main/java/g0001_0100/s0057_insert_interval/readme.md index baeb6eb2..b1816497 100644 --- a/src/main/java/g0001_0100/s0057_insert_interval/readme.md +++ b/src/main/java/g0001_0100/s0057_insert_interval/readme.md @@ -10,13 +10,13 @@ Return `intervals` _after the insertion_. **Example 1:** -**Input:** intervals = [[1,3],[6,9]], newInterval = [2,5] +**Input:** intervals = \[\[1,3],[6,9]], newInterval = [2,5] **Output:** [[1,5],[6,9]] **Example 2:** -**Input:** intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8] +**Input:** intervals = \[\[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8] **Output:** [[1,2],[3,10],[12,16]] @@ -30,13 +30,13 @@ Return `intervals` _after the insertion_. **Example 4:** -**Input:** intervals = [[1,5]], newInterval = [2,3] +**Input:** intervals = \[\[1,5]], newInterval = [2,3] **Output:** [[1,5]] **Example 5:** -**Input:** intervals = [[1,5]], newInterval = [2,7] +**Input:** intervals = \[\[1,5]], newInterval = [2,7] **Output:** [[1,7]] diff --git a/src/main/java/g0001_0100/s0063_unique_paths_ii/readme.md b/src/main/java/g0001_0100/s0063_unique_paths_ii/readme.md index a48054dc..6e39d48e 100644 --- a/src/main/java/g0001_0100/s0063_unique_paths_ii/readme.md +++ b/src/main/java/g0001_0100/s0063_unique_paths_ii/readme.md @@ -14,7 +14,7 @@ An obstacle and space is marked as `1` and `0` respectively in the grid. ![](https://assets.leetcode.com/uploads/2020/11/04/robot1.jpg) -**Input:** obstacleGrid = [[0,0,0],[0,1,0],[0,0,0]] +**Input:** obstacleGrid = \[\[0,0,0],[0,1,0],[0,0,0]] **Output:** 2 @@ -24,7 +24,7 @@ An obstacle and space is marked as `1` and `0` respectively in the grid. ![](https://assets.leetcode.com/uploads/2020/11/04/robot2.jpg) -**Input:** obstacleGrid = [[0,1],[0,0]] +**Input:** obstacleGrid = \[\[0,1],[0,0]] **Output:** 1 diff --git a/src/main/java/g0001_0100/s0064_minimum_path_sum/readme.md b/src/main/java/g0001_0100/s0064_minimum_path_sum/readme.md index 7a6c5d2c..6cf29b1e 100644 --- a/src/main/java/g0001_0100/s0064_minimum_path_sum/readme.md +++ b/src/main/java/g0001_0100/s0064_minimum_path_sum/readme.md @@ -10,7 +10,7 @@ Given a `m x n` `grid` filled with non-negative numbers, find a path from top le ![](https://assets.leetcode.com/uploads/2020/11/05/minpath.jpg) -**Input:** grid = [[1,3,1],[1,5,1],[4,2,1]] +**Input:** grid = \[\[1,3,1],[1,5,1],[4,2,1]] **Output:** 7 @@ -18,7 +18,7 @@ Given a `m x n` `grid` filled with non-negative numbers, find a path from top le **Example 2:** -**Input:** grid = [[1,2,3],[4,5,6]] +**Input:** grid = \[\[1,2,3],[4,5,6]] **Output:** 12 diff --git a/src/main/java/g0001_0100/s0073_set_matrix_zeroes/readme.md b/src/main/java/g0001_0100/s0073_set_matrix_zeroes/readme.md index 161de161..9c9c3298 100644 --- a/src/main/java/g0001_0100/s0073_set_matrix_zeroes/readme.md +++ b/src/main/java/g0001_0100/s0073_set_matrix_zeroes/readme.md @@ -10,7 +10,7 @@ You must do it [in place](https://en.wikipedia.org/wiki/In-place_algorithm). ![](https://assets.leetcode.com/uploads/2020/08/17/mat1.jpg) -**Input:** matrix = [[1,1,1],[1,0,1],[1,1,1]] +**Input:** matrix = \[\[1,1,1],[1,0,1],[1,1,1]] **Output:** [[1,0,1],[0,0,0],[1,0,1]] @@ -18,7 +18,7 @@ You must do it [in place](https://en.wikipedia.org/wiki/In-place_algorithm). ![](https://assets.leetcode.com/uploads/2020/08/17/mat2.jpg) -**Input:** matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]] +**Input:** matrix = \[\[0,1,2,0],[3,4,5,2],[1,3,1,5]] **Output:** [[0,0,0,0],[0,4,5,0],[0,3,1,0]] diff --git a/src/main/java/g0001_0100/s0074_search_a_2d_matrix/readme.md b/src/main/java/g0001_0100/s0074_search_a_2d_matrix/readme.md index 24ef508c..81a48337 100644 --- a/src/main/java/g0001_0100/s0074_search_a_2d_matrix/readme.md +++ b/src/main/java/g0001_0100/s0074_search_a_2d_matrix/readme.md @@ -11,7 +11,7 @@ Write an efficient algorithm that searches for a value in an `m x n` matrix. Thi ![](https://assets.leetcode.com/uploads/2020/10/05/mat.jpg) -**Input:** matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3 +**Input:** matrix = \[\[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3 **Output:** true @@ -19,7 +19,7 @@ Write an efficient algorithm that searches for a value in an `m x n` matrix. Thi ![](https://assets.leetcode.com/uploads/2020/10/05/mat2.jpg) -**Input:** matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13 +**Input:** matrix = \[\[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13 **Output:** false diff --git a/src/main/java/g0001_0100/s0079_word_search/readme.md b/src/main/java/g0001_0100/s0079_word_search/readme.md index 385c3f1f..2601b424 100644 --- a/src/main/java/g0001_0100/s0079_word_search/readme.md +++ b/src/main/java/g0001_0100/s0079_word_search/readme.md @@ -10,7 +10,7 @@ The word can be constructed from letters of sequentially adjacent cells, where a ![](https://assets.leetcode.com/uploads/2020/11/04/word2.jpg) -**Input:** board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED" +**Input:** board = \[\["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED" **Output:** true @@ -18,7 +18,7 @@ The word can be constructed from letters of sequentially adjacent cells, where a ![](https://assets.leetcode.com/uploads/2020/11/04/word-1.jpg) -**Input:** board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE" +**Input:** board = \[\["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE" **Output:** true @@ -26,7 +26,7 @@ The word can be constructed from letters of sequentially adjacent cells, where a ![](https://assets.leetcode.com/uploads/2020/10/15/word3.jpg) -**Input:** board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCB" +**Input:** board = \[\["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCB" **Output:** false diff --git a/src/main/java/g0001_0100/s0085_maximal_rectangle/readme.md b/src/main/java/g0001_0100/s0085_maximal_rectangle/readme.md index 9b3953b2..27aad2a8 100644 --- a/src/main/java/g0001_0100/s0085_maximal_rectangle/readme.md +++ b/src/main/java/g0001_0100/s0085_maximal_rectangle/readme.md @@ -8,7 +8,7 @@ Given a `rows x cols` binary `matrix` filled with `0`'s and `1`'s, find the larg ![](https://assets.leetcode.com/uploads/2020/09/14/maximal.jpg) -**Input:** matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]] +**Input:** matrix = \[\["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]] **Output:** 6 @@ -22,19 +22,19 @@ Given a `rows x cols` binary `matrix` filled with `0`'s and `1`'s, find the larg **Example 3:** -**Input:** matrix = [["0"]] +**Input:** matrix = \[\["0"]] **Output:** 0 **Example 4:** -**Input:** matrix = [["1"]] +**Input:** matrix = \[\["1"]] **Output:** 1 **Example 5:** -**Input:** matrix = [["0","0"]] +**Input:** matrix = \[\["0","0"]] **Output:** 0 diff --git a/src/main/java/g0101_0200/s0120_triangle/readme.md b/src/main/java/g0101_0200/s0120_triangle/readme.md index ec8ca834..f7b6dba7 100644 --- a/src/main/java/g0101_0200/s0120_triangle/readme.md +++ b/src/main/java/g0101_0200/s0120_triangle/readme.md @@ -8,7 +8,7 @@ For each step, you may move to an adjacent number of the row below. More formall **Example 1:** -**Input:** triangle = [[2],[3,4],[6,5,7],[4,1,8,3]] +**Input:** triangle = \[\[2],[3,4],[6,5,7],[4,1,8,3]] **Output:** 11 @@ -23,7 +23,7 @@ For each step, you may move to an adjacent number of the row below. More formall **Example 2:** -**Input:** triangle = [[-10]] +**Input:** triangle = \[\[-10]] **Output:** -10 diff --git a/src/main/java/g0101_0200/s0130_surrounded_regions/readme.md b/src/main/java/g0101_0200/s0130_surrounded_regions/readme.md index 5b319de4..a3daa8ab 100644 --- a/src/main/java/g0101_0200/s0130_surrounded_regions/readme.md +++ b/src/main/java/g0101_0200/s0130_surrounded_regions/readme.md @@ -10,7 +10,7 @@ A region is **captured** by flipping all `'O'`s into `'X'`s in that surrounded r ![](https://assets.leetcode.com/uploads/2021/02/19/xogrid.jpg) -**Input:** board = [["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]] +**Input:** board = \[\["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]] **Output:** [["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X","X"]] @@ -18,7 +18,7 @@ A region is **captured** by flipping all `'O'`s into `'X'`s in that surrounded r **Example 2:** -**Input:** board = [["X"]] +**Input:** board = \[\["X"]] **Output:** [["X"]] diff --git a/src/main/java/g0101_0200/s0133_clone_graph/readme.md b/src/main/java/g0101_0200/s0133_clone_graph/readme.md index 3861d60e..096e07bf 100644 --- a/src/main/java/g0101_0200/s0133_clone_graph/readme.md +++ b/src/main/java/g0101_0200/s0133_clone_graph/readme.md @@ -22,7 +22,7 @@ The given node will always be the first node with `val = 1`. You must return the ![](https://assets.leetcode.com/uploads/2019/11/04/133_clone_graph_question.png) -**Input:** adjList = [[2,4],[1,3],[2,4],[1,3]] +**Input:** adjList = \[\[2,4],[1,3],[2,4],[1,3]] **Output:** [[2,4],[1,3],[2,4],[1,3]] @@ -38,7 +38,7 @@ The given node will always be the first node with `val = 1`. You must return the ![](https://assets.leetcode.com/uploads/2020/01/07/graph.png) -**Input:** adjList = [[]] +**Input:** adjList = \[\[]] **Output:** [[]] @@ -56,7 +56,7 @@ The given node will always be the first node with `val = 1`. You must return the ![](https://assets.leetcode.com/uploads/2020/01/07/graph-1.png) -**Input:** adjList = [[2],[1]] +**Input:** adjList = \[\[2],[1]] **Output:** [[2],[1]] diff --git a/src/main/java/g0101_0200/s0138_copy_list_with_random_pointer/readme.md b/src/main/java/g0101_0200/s0138_copy_list_with_random_pointer/readme.md index 9ab45325..2f639b44 100644 --- a/src/main/java/g0101_0200/s0138_copy_list_with_random_pointer/readme.md +++ b/src/main/java/g0101_0200/s0138_copy_list_with_random_pointer/readme.md @@ -21,7 +21,7 @@ Your code will **only** be given the `head` of the original linked list. ![](https://assets.leetcode.com/uploads/2019/12/18/e1.png) -**Input:** head = [[7,null],[13,0],[11,4],[10,2],[1,0]] +**Input:** head = \[\[7,null],[13,0],[11,4],[10,2],[1,0]] **Output:** [[7,null],[13,0],[11,4],[10,2],[1,0]] @@ -29,7 +29,7 @@ Your code will **only** be given the `head` of the original linked list. ![](https://assets.leetcode.com/uploads/2019/12/18/e2.png) -**Input:** head = [[1,1],[2,1]] +**Input:** head = \[\[1,1],[2,1]] **Output:** [[1,1],[2,1]] @@ -37,7 +37,7 @@ Your code will **only** be given the `head` of the original linked list. **![](https://assets.leetcode.com/uploads/2019/12/18/e3.png)** -**Input:** head = [[3,null],[3,0],[3,null]] +**Input:** head = \[\[3,null],[3,0],[3,null]] **Output:** [[3,null],[3,0],[3,null]] diff --git a/src/main/java/g0101_0200/s0149_max_points_on_a_line/readme.md b/src/main/java/g0101_0200/s0149_max_points_on_a_line/readme.md index dd1e54c8..4db736ed 100644 --- a/src/main/java/g0101_0200/s0149_max_points_on_a_line/readme.md +++ b/src/main/java/g0101_0200/s0149_max_points_on_a_line/readme.md @@ -8,7 +8,7 @@ Given an array of `points` where points[i] = [xi, yi ![](https://assets.leetcode.com/uploads/2021/02/25/plane1.jpg) -**Input:** points = [[1,1],[2,2],[3,3]] +**Input:** points = \[\[1,1],[2,2],[3,3]] **Output:** 3 @@ -16,7 +16,7 @@ Given an array of `points` where points[i] = [xi, yi ![](https://assets.leetcode.com/uploads/2021/02/25/plane2.jpg) -**Input:** points = [[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]] +**Input:** points = \[\[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]] **Output:** 4 diff --git a/src/main/java/g0101_0200/s0174_dungeon_game/readme.md b/src/main/java/g0101_0200/s0174_dungeon_game/readme.md index 5c6aad9a..05195385 100644 --- a/src/main/java/g0101_0200/s0174_dungeon_game/readme.md +++ b/src/main/java/g0101_0200/s0174_dungeon_game/readme.md @@ -18,7 +18,7 @@ Return _the knight's minimum initial health so that he can rescue the princess_. ![](https://assets.leetcode.com/uploads/2021/03/13/dungeon-grid-1.jpg) -**Input:** dungeon = [[-2,-3,3],[-5,-10,1],[10,30,-5]] +**Input:** dungeon = \[\[-2,-3,3],[-5,-10,1],[10,30,-5]] **Output:** 7 @@ -26,7 +26,7 @@ Return _the knight's minimum initial health so that he can rescue the princess_. **Example 2:** -**Input:** dungeon = [[0]] +**Input:** dungeon = \[\[0]] **Output:** 1 diff --git a/src/main/java/g0201_0300/s0207_course_schedule/readme.md b/src/main/java/g0201_0300/s0207_course_schedule/readme.md index 44ed0f71..d75053c6 100644 --- a/src/main/java/g0201_0300/s0207_course_schedule/readme.md +++ b/src/main/java/g0201_0300/s0207_course_schedule/readme.md @@ -10,7 +10,7 @@ Return `true` if you can finish all courses. Otherwise, return `false`. **Example 1:** -**Input:** numCourses = 2, prerequisites = [[1,0]] +**Input:** numCourses = 2, prerequisites = \[\[1,0]] **Output:** true @@ -18,7 +18,7 @@ Return `true` if you can finish all courses. Otherwise, return `false`. **Example 2:** -**Input:** numCourses = 2, prerequisites = [[1,0],[0,1]] +**Input:** numCourses = 2, prerequisites = \[\[1,0],[0,1]] **Output:** false diff --git a/src/main/java/g0201_0300/s0210_course_schedule_ii/readme.md b/src/main/java/g0201_0300/s0210_course_schedule_ii/readme.md index 63fc4c61..c4a2c712 100644 --- a/src/main/java/g0201_0300/s0210_course_schedule_ii/readme.md +++ b/src/main/java/g0201_0300/s0210_course_schedule_ii/readme.md @@ -10,7 +10,7 @@ Return _the ordering of courses you should take to finish all courses_. If there **Example 1:** -**Input:** numCourses = 2, prerequisites = [[1,0]] +**Input:** numCourses = 2, prerequisites = \[\[1,0]] **Output:** [0,1] @@ -21,7 +21,7 @@ Return _the ordering of courses you should take to finish all courses_. If there **Example 2:** -**Input:** numCourses = 4, prerequisites = [[1,0],[2,0],[3,1],[3,2]] +**Input:** numCourses = 4, prerequisites = \[\[1,0],[2,0],[3,1],[3,2]] **Output:** [0,2,1,3] diff --git a/src/main/java/g0201_0300/s0212_word_search_ii/readme.md b/src/main/java/g0201_0300/s0212_word_search_ii/readme.md index 4eb25373..db9d2a39 100644 --- a/src/main/java/g0201_0300/s0212_word_search_ii/readme.md +++ b/src/main/java/g0201_0300/s0212_word_search_ii/readme.md @@ -10,7 +10,7 @@ Each word must be constructed from letters of sequentially adjacent cells, where ![](https://assets.leetcode.com/uploads/2020/11/07/search1.jpg) -**Input:** board = [["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]], words = ["oath","pea","eat","rain"] +**Input:** board = \[\["o","a","a","n"],["e","t","a","e"],["i","h","k","r"],["i","f","l","v"]], words = ["oath","pea","eat","rain"] **Output:** ["eat","oath"] @@ -18,7 +18,7 @@ Each word must be constructed from letters of sequentially adjacent cells, where ![](https://assets.leetcode.com/uploads/2020/11/07/search2.jpg) -**Input:** board = [["a","b"],["c","d"]], words = ["abcb"] +**Input:** board = \[\["a","b"],["c","d"]], words = ["abcb"] **Output:** [] diff --git a/src/main/java/g0201_0300/s0218_the_skyline_problem/readme.md b/src/main/java/g0201_0300/s0218_the_skyline_problem/readme.md index 00b2f824..ac06ba8a 100644 --- a/src/main/java/g0201_0300/s0218_the_skyline_problem/readme.md +++ b/src/main/java/g0201_0300/s0218_the_skyline_problem/readme.md @@ -20,7 +20,7 @@ The **skyline** should be represented as a list of "key points" **sorted by thei ![](https://assets.leetcode.com/uploads/2020/12/01/merged.jpg) -**Input:** buildings = [[2,9,10],[3,7,15],[5,12,12],[15,20,10],[19,24,8]] +**Input:** buildings = \[\[2,9,10],[3,7,15],[5,12,12],[15,20,10],[19,24,8]] **Output:** [[2,10],[3,15],[7,12],[12,0],[15,10],[20,8],[24,0]] @@ -32,7 +32,7 @@ The **skyline** should be represented as a list of "key points" **sorted by thei **Example 2:** -**Input:** buildings = [[0,2,3],[2,5,3]] +**Input:** buildings = \[\[0,2,3],[2,5,3]] **Output:** [[0,3],[5,0]] diff --git a/src/main/java/g0201_0300/s0221_maximal_square/readme.md b/src/main/java/g0201_0300/s0221_maximal_square/readme.md index 6d326d7f..e77c621e 100644 --- a/src/main/java/g0201_0300/s0221_maximal_square/readme.md +++ b/src/main/java/g0201_0300/s0221_maximal_square/readme.md @@ -8,7 +8,7 @@ Given an `m x n` binary `matrix` filled with `0`'s and `1`'s, _find the largest ![](https://assets.leetcode.com/uploads/2020/11/26/max1grid.jpg) -**Input:** matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]] +**Input:** matrix = \[\["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]] **Output:** 4 @@ -16,13 +16,13 @@ Given an `m x n` binary `matrix` filled with `0`'s and `1`'s, _find the largest ![](https://assets.leetcode.com/uploads/2020/11/26/max2grid.jpg) -**Input:** matrix = [["0","1"],["1","0"]] +**Input:** matrix = \[\["0","1"],["1","0"]] **Output:** 1 **Example 3:** -**Input:** matrix = [["0"]] +**Input:** matrix = \[\["0"]] **Output:** 0 diff --git a/src/main/java/g0201_0300/s0240_search_a_2d_matrix_ii/readme.md b/src/main/java/g0201_0300/s0240_search_a_2d_matrix_ii/readme.md index 0ad911d1..4e1733af 100644 --- a/src/main/java/g0201_0300/s0240_search_a_2d_matrix_ii/readme.md +++ b/src/main/java/g0201_0300/s0240_search_a_2d_matrix_ii/readme.md @@ -11,7 +11,7 @@ Write an efficient algorithm that searches for a `target` value in an `m x n` in ![](https://assets.leetcode.com/uploads/2020/11/24/searchgrid2.jpg) -**Input:** matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 5 +**Input:** matrix = \[\[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 5 **Output:** true @@ -19,7 +19,7 @@ Write an efficient algorithm that searches for a `target` value in an `m x n` in ![](https://assets.leetcode.com/uploads/2020/11/24/searchgrid.jpg) -**Input:** matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 20 +**Input:** matrix = \[\[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], target = 20 **Output:** false diff --git a/src/main/java/g0201_0300/s0289_game_of_life/readme.md b/src/main/java/g0201_0300/s0289_game_of_life/readme.md index 1d2e1780..c932d306 100644 --- a/src/main/java/g0201_0300/s0289_game_of_life/readme.md +++ b/src/main/java/g0201_0300/s0289_game_of_life/readme.md @@ -17,7 +17,7 @@ The next state is created by applying the above rules simultaneously to every ce ![](https://assets.leetcode.com/uploads/2020/12/26/grid1.jpg) -**Input:** board = [[0,1,0],[0,0,1],[1,1,1],[0,0,0]] +**Input:** board = \[\[0,1,0],[0,0,1],[1,1,1],[0,0,0]] **Output:** [[0,0,0],[1,0,1],[0,1,1],[0,1,0]] @@ -25,7 +25,7 @@ The next state is created by applying the above rules simultaneously to every ce ![](https://assets.leetcode.com/uploads/2020/12/26/grid2.jpg) -**Input:** board = [[1,1],[1,0]] +**Input:** board = \[\[1,1],[1,0]] **Output:** [[1,1],[1,1]] diff --git a/src/main/java/g0301_0400/s0310_minimum_height_trees/readme.md b/src/main/java/g0301_0400/s0310_minimum_height_trees/readme.md index 6ffc1899..f765b36e 100644 --- a/src/main/java/g0301_0400/s0310_minimum_height_trees/readme.md +++ b/src/main/java/g0301_0400/s0310_minimum_height_trees/readme.md @@ -14,7 +14,7 @@ The **height** of a rooted tree is the number of edges on the longest downward p ![](https://assets.leetcode.com/uploads/2020/09/01/e1.jpg) -**Input:** n = 4, edges = [[1,0],[1,2],[1,3]] +**Input:** n = 4, edges = \[\[1,0],[1,2],[1,3]] **Output:** [1] @@ -24,7 +24,7 @@ The **height** of a rooted tree is the number of edges on the longest downward p ![](https://assets.leetcode.com/uploads/2020/09/01/e2.jpg) -**Input:** n = 6, edges = [[3,0],[3,1],[3,2],[3,4],[5,4]] +**Input:** n = 6, edges = \[\[3,0],[3,1],[3,2],[3,4],[5,4]] **Output:** [3,4] diff --git a/src/main/java/g0301_0400/s0329_longest_increasing_path_in_a_matrix/readme.md b/src/main/java/g0301_0400/s0329_longest_increasing_path_in_a_matrix/readme.md index edb528f5..53bbc2f5 100644 --- a/src/main/java/g0301_0400/s0329_longest_increasing_path_in_a_matrix/readme.md +++ b/src/main/java/g0301_0400/s0329_longest_increasing_path_in_a_matrix/readme.md @@ -10,7 +10,7 @@ From each cell, you can either move in four directions: left, right, up, or down ![](https://assets.leetcode.com/uploads/2021/01/05/grid1.jpg) -**Input:** matrix = [[9,9,4],[6,6,8],[2,1,1]] +**Input:** matrix = \[\[9,9,4],[6,6,8],[2,1,1]] **Output:** 4 @@ -20,7 +20,7 @@ From each cell, you can either move in four directions: left, right, up, or down ![](https://assets.leetcode.com/uploads/2021/01/27/tmp-grid.jpg) -**Input:** matrix = [[3,4,5],[3,2,6],[2,2,1]] +**Input:** matrix = \[\[3,4,5],[3,2,6],[2,2,1]] **Output:** 4 @@ -28,7 +28,7 @@ From each cell, you can either move in four directions: left, right, up, or down **Example 3:** -**Input:** matrix = [[1]] +**Input:** matrix = \[\[1]] **Output:** 1 diff --git a/src/main/java/g0301_0400/s0332_reconstruct_itinerary/readme.md b/src/main/java/g0301_0400/s0332_reconstruct_itinerary/readme.md index 7dd1ad2b..2b834856 100644 --- a/src/main/java/g0301_0400/s0332_reconstruct_itinerary/readme.md +++ b/src/main/java/g0301_0400/s0332_reconstruct_itinerary/readme.md @@ -14,7 +14,7 @@ You may assume all tickets form at least one valid itinerary. You must use all t ![](https://assets.leetcode.com/uploads/2021/03/14/itinerary1-graph.jpg) -**Input:** tickets = [["MUC","LHR"],["JFK","MUC"],["SFO","SJC"],["LHR","SFO"]] +**Input:** tickets = \[\["MUC","LHR"],["JFK","MUC"],["SFO","SJC"],["LHR","SFO"]] **Output:** ["JFK","MUC","LHR","SFO","SJC"] @@ -22,7 +22,7 @@ You may assume all tickets form at least one valid itinerary. You must use all t ![](https://assets.leetcode.com/uploads/2021/03/14/itinerary2-graph.jpg) -**Input:** tickets = [["JFK","SFO"],["JFK","ATL"],["SFO","ATL"],["ATL","JFK"],["ATL","SFO"]] +**Input:** tickets = \[\["JFK","SFO"],["JFK","ATL"],["SFO","ATL"],["ATL","JFK"],["ATL","SFO"]] **Output:** ["JFK","ATL","JFK","SFO","ATL","SFO"] diff --git a/src/main/java/g0301_0400/s0341_flatten_nested_list_iterator/readme.md b/src/main/java/g0301_0400/s0341_flatten_nested_list_iterator/readme.md index e511c9a6..56a55ce6 100644 --- a/src/main/java/g0301_0400/s0341_flatten_nested_list_iterator/readme.md +++ b/src/main/java/g0301_0400/s0341_flatten_nested_list_iterator/readme.md @@ -22,7 +22,7 @@ If `res` matches the expected flattened list, then your code will be judged as c **Example 1:** -**Input:** nestedList = [[1,1],2,[1,1]] +**Input:** nestedList = \[\[1,1],2,[1,1]] **Output:** [1,1,2,1,1] diff --git a/src/main/java/g0301_0400/s0354_russian_doll_envelopes/readme.md b/src/main/java/g0301_0400/s0354_russian_doll_envelopes/readme.md index 7191bc1b..7d02f303 100644 --- a/src/main/java/g0301_0400/s0354_russian_doll_envelopes/readme.md +++ b/src/main/java/g0301_0400/s0354_russian_doll_envelopes/readme.md @@ -12,7 +12,7 @@ Return _the maximum number of envelopes you can Russian doll (i.e., put one insi **Example 1:** -**Input:** envelopes = [[5,4],[6,4],[6,7],[2,3]] +**Input:** envelopes = \[\[5,4],[6,4],[6,7],[2,3]] **Output:** 3 @@ -20,7 +20,7 @@ Return _the maximum number of envelopes you can Russian doll (i.e., put one insi **Example 2:** -**Input:** envelopes = [[1,1],[1,1],[1,1]] +**Input:** envelopes = \[\[1,1],[1,1],[1,1]] **Output:** 1 diff --git a/src/main/java/g0301_0400/s0363_max_sum_of_rectangle_no_larger_than_k/readme.md b/src/main/java/g0301_0400/s0363_max_sum_of_rectangle_no_larger_than_k/readme.md index f1c69d8b..30f1d492 100644 --- a/src/main/java/g0301_0400/s0363_max_sum_of_rectangle_no_larger_than_k/readme.md +++ b/src/main/java/g0301_0400/s0363_max_sum_of_rectangle_no_larger_than_k/readme.md @@ -10,7 +10,7 @@ It is **guaranteed** that there will be a rectangle with a sum no larger than `k ![](https://assets.leetcode.com/uploads/2021/03/18/sum-grid.jpg) -**Input:** matrix = [[1,0,1],[0,-2,3]], k = 2 +**Input:** matrix = \[\[1,0,1],[0,-2,3]], k = 2 **Output:** 2 @@ -18,7 +18,7 @@ It is **guaranteed** that there will be a rectangle with a sum no larger than `k **Example 2:** -**Input:** matrix = [[2,2,-1]], k = 3 +**Input:** matrix = \[\[2,2,-1]], k = 3 **Output:** 3 diff --git a/src/main/java/g0301_0400/s0378_kth_smallest_element_in_a_sorted_matrix/readme.md b/src/main/java/g0301_0400/s0378_kth_smallest_element_in_a_sorted_matrix/readme.md index 5faca8aa..07eab0ab 100644 --- a/src/main/java/g0301_0400/s0378_kth_smallest_element_in_a_sorted_matrix/readme.md +++ b/src/main/java/g0301_0400/s0378_kth_smallest_element_in_a_sorted_matrix/readme.md @@ -10,7 +10,7 @@ You must find a solution with a memory complexity better than O(n2O(n2result[i] = [r ![](https://assets.leetcode.com/uploads/2021/06/08/waterflow-grid.jpg) -**Input:** heights = [[1,2,2,3,5],[3,2,3,4,4],[2,4,5,3,1],[6,7,1,4,5],[5,1,1,2,4]] +**Input:** heights = \[\[1,2,2,3,5],[3,2,3,4,4],[2,4,5,3,1],[6,7,1,4,5],[5,1,1,2,4]] **Output:** [[0,4],[1,3],[1,4],[2,2],[3,0],[3,1],[4,0]] **Example 2:** -**Input:** heights = [[2,1],[1,2]] +**Input:** heights = \[\[2,1],[1,2]] **Output:** [[0,0],[0,1],[1,0],[1,1]] diff --git a/src/main/java/g0401_0500/s0419_battleships_in_a_board/readme.md b/src/main/java/g0401_0500/s0419_battleships_in_a_board/readme.md index aef38a1c..3b52c0c4 100644 --- a/src/main/java/g0401_0500/s0419_battleships_in_a_board/readme.md +++ b/src/main/java/g0401_0500/s0419_battleships_in_a_board/readme.md @@ -10,13 +10,13 @@ Given an `m x n` matrix `board` where each cell is a battleship `'X'` or empty ` ![](https://assets.leetcode.com/uploads/2021/04/10/battelship-grid.jpg) -**Input:** board = [["X",".",".","X"],[".",".",".","X"],[".",".",".","X"]] +**Input:** board = \[\["X",".",".","X"],[".",".",".","X"],[".",".",".","X"]] **Output:** 2 **Example 2:** -**Input:** board = [["."]] +**Input:** board = \[\["."]] **Output:** 0 diff --git a/src/main/java/g0401_0500/s0427_construct_quad_tree/readme.md b/src/main/java/g0401_0500/s0427_construct_quad_tree/readme.md index 612fdff5..b6b9e1f6 100644 --- a/src/main/java/g0401_0500/s0427_construct_quad_tree/readme.md +++ b/src/main/java/g0401_0500/s0427_construct_quad_tree/readme.md @@ -44,7 +44,7 @@ If the value of `isLeaf` or `val` is True we represent it as **1** in the list ` ![](https://assets.leetcode.com/uploads/2020/02/11/grid1.png) -**Input:** grid = [[0,1],[1,0]] +**Input:** grid = \[\[0,1],[1,0]] **Output:** [[0,1],[1,0],[1,1],[1,1],[1,0]] @@ -59,7 +59,7 @@ If the value of `isLeaf` or `val` is True we represent it as **1** in the list ` ![](https://assets.leetcode.com/uploads/2020/02/12/e2mat.png) -**Input:** grid = [[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0]] +**Input:** grid = \[\[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0],[1,1,1,1,0,0,0,0]] **Output:** [[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]] diff --git a/src/main/java/g0401_0500/s0435_non_overlapping_intervals/readme.md b/src/main/java/g0401_0500/s0435_non_overlapping_intervals/readme.md index e1dee259..09e16ff2 100644 --- a/src/main/java/g0401_0500/s0435_non_overlapping_intervals/readme.md +++ b/src/main/java/g0401_0500/s0435_non_overlapping_intervals/readme.md @@ -6,7 +6,7 @@ Given an array of intervals `intervals` where intervals[i] = [starti< **Example 1:** -**Input:** intervals = [[1,2],[2,3],[3,4],[1,3]] +**Input:** intervals = \[\[1,2],[2,3],[3,4],[1,3]] **Output:** 1 @@ -14,7 +14,7 @@ Given an array of intervals `intervals` where intervals[i] = [starti< **Example 2:** -**Input:** intervals = [[1,2],[1,2],[1,2]] +**Input:** intervals = \[\[1,2],[1,2],[1,2]] **Output:** 2 @@ -22,7 +22,7 @@ Given an array of intervals `intervals` where intervals[i] = [starti< **Example 3:** -**Input:** intervals = [[1,2],[2,3]] +**Input:** intervals = \[\[1,2],[2,3]] **Output:** 0 diff --git a/src/main/java/g0401_0500/s0436_find_right_interval/readme.md b/src/main/java/g0401_0500/s0436_find_right_interval/readme.md index 3d231df8..440243b0 100644 --- a/src/main/java/g0401_0500/s0436_find_right_interval/readme.md +++ b/src/main/java/g0401_0500/s0436_find_right_interval/readme.md @@ -10,7 +10,7 @@ Return _an array of **right interval** indices for each interval `i`_. If no **r **Example 1:** -**Input:** intervals = [[1,2]] +**Input:** intervals = \[\[1,2]] **Output:** [-1] @@ -18,7 +18,7 @@ Return _an array of **right interval** indices for each interval `i`_. If no **r **Example 2:** -**Input:** intervals = [[3,4],[2,3],[1,2]] +**Input:** intervals = \[\[3,4],[2,3],[1,2]] **Output:** [-1,0,1] @@ -32,7 +32,7 @@ The right interval for [1,2] is [2,3] since start1 = 2 is the smalles **Example 3:** -**Input:** intervals = [[1,4],[2,3],[3,4]] +**Input:** intervals = \[\[1,4],[2,3],[3,4]] **Output:** [-1,2,-1] diff --git a/src/main/java/g0401_0500/s0452_minimum_number_of_arrows_to_burst_balloons/readme.md b/src/main/java/g0401_0500/s0452_minimum_number_of_arrows_to_burst_balloons/readme.md index b788d091..733bffd8 100644 --- a/src/main/java/g0401_0500/s0452_minimum_number_of_arrows_to_burst_balloons/readme.md +++ b/src/main/java/g0401_0500/s0452_minimum_number_of_arrows_to_burst_balloons/readme.md @@ -10,7 +10,7 @@ Given the array `points`, return _the **minimum** number of arrows that must be **Example 1:** -**Input:** points = [[10,16],[2,8],[1,6],[7,12]] +**Input:** points = \[\[10,16],[2,8],[1,6],[7,12]] **Output:** 2 @@ -22,7 +22,7 @@ Given the array `points`, return _the **minimum** number of arrows that must be **Example 2:** -**Input:** points = [[1,2],[3,4],[5,6],[7,8]] +**Input:** points = \[\[1,2],[3,4],[5,6],[7,8]] **Output:** 4 @@ -30,7 +30,7 @@ Given the array `points`, return _the **minimum** number of arrows that must be **Example 3:** -**Input:** points = [[1,2],[2,3],[3,4],[4,5]] +**Input:** points = \[\[1,2],[2,3],[3,4],[4,5]] **Output:** 2 diff --git a/src/main/java/g0401_0500/s0463_island_perimeter/readme.md b/src/main/java/g0401_0500/s0463_island_perimeter/readme.md index 0012b916..08ff1586 100644 --- a/src/main/java/g0401_0500/s0463_island_perimeter/readme.md +++ b/src/main/java/g0401_0500/s0463_island_perimeter/readme.md @@ -12,7 +12,7 @@ The island doesn't have "lakes", meaning the water inside isn't connected to the ![](https://assets.leetcode.com/uploads/2018/10/12/island.png) -**Input:** grid = [[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]] +**Input:** grid = \[\[0,1,0,0],[1,1,1,0],[0,1,0,0],[1,1,0,0]] **Output:** 16 @@ -20,13 +20,13 @@ The island doesn't have "lakes", meaning the water inside isn't connected to the **Example 2:** -**Input:** grid = [[1]] +**Input:** grid = \[\[1]] **Output:** 4 **Example 3:** -**Input:** grid = [[1,0]] +**Input:** grid = \[\[1,0]] **Output:** 4 diff --git a/src/main/java/g0401_0500/s0498_diagonal_traverse/readme.md b/src/main/java/g0401_0500/s0498_diagonal_traverse/readme.md index 4e7605c2..00bfa0a2 100644 --- a/src/main/java/g0401_0500/s0498_diagonal_traverse/readme.md +++ b/src/main/java/g0401_0500/s0498_diagonal_traverse/readme.md @@ -8,13 +8,13 @@ Given an `m x n` matrix `mat`, return _an array of all the elements of the array ![](https://assets.leetcode.com/uploads/2021/04/10/diag1-grid.jpg) -**Input:** mat = [[1,2,3],[4,5,6],[7,8,9]] +**Input:** mat = \[\[1,2,3],[4,5,6],[7,8,9]] **Output:** [1,2,4,7,5,3,6,8,9] **Example 2:** -**Input:** mat = [[1,2],[3,4]] +**Input:** mat = \[\[1,2],[3,4]] **Output:** [1,2,3,4] diff --git a/src/main/java/g0501_0600/s0529_minesweeper/readme.md b/src/main/java/g0501_0600/s0529_minesweeper/readme.md index 080bee8b..50a3f291 100644 --- a/src/main/java/g0501_0600/s0529_minesweeper/readme.md +++ b/src/main/java/g0501_0600/s0529_minesweeper/readme.md @@ -25,7 +25,7 @@ Return _the board after revealing this position according to the following rules ![](https://assets.leetcode.com/uploads/2018/10/12/minesweeper_example_1.png) -**Input:** board = [["E","E","E","E","E"],["E","E","M","E","E"],["E","E","E","E","E"],["E","E","E","E","E"]], click = [3,0] +**Input:** board = \[\["E","E","E","E","E"],["E","E","M","E","E"],["E","E","E","E","E"],["E","E","E","E","E"]], click = [3,0] **Output:** [["B","1","E","1","B"],["B","1","M","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]] @@ -33,7 +33,7 @@ Return _the board after revealing this position according to the following rules ![](https://assets.leetcode.com/uploads/2018/10/12/minesweeper_example_2.png) -**Input:** board = [["B","1","E","1","B"],["B","1","M","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]], click = [1,2] +**Input:** board = \[\["B","1","E","1","B"],["B","1","M","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]], click = [1,2] **Output:** [["B","1","E","1","B"],["B","1","X","1","B"],["B","1","1","1","B"],["B","B","B","B","B"]] diff --git a/src/main/java/g0501_0600/s0542_01_matrix/readme.md b/src/main/java/g0501_0600/s0542_01_matrix/readme.md index 4105a96a..9b7d7b9d 100644 --- a/src/main/java/g0501_0600/s0542_01_matrix/readme.md +++ b/src/main/java/g0501_0600/s0542_01_matrix/readme.md @@ -10,7 +10,7 @@ The distance between two adjacent cells is `1`. ![](https://assets.leetcode.com/uploads/2021/04/24/01-1-grid.jpg) -**Input:** mat = [[0,0,0],[0,1,0],[0,0,0]] +**Input:** mat = \[\[0,0,0],[0,1,0],[0,0,0]] **Output:** [[0,0,0],[0,1,0],[0,0,0]] @@ -18,7 +18,7 @@ The distance between two adjacent cells is `1`. ![](https://assets.leetcode.com/uploads/2021/04/24/01-2-grid.jpg) -**Input:** mat = [[0,0,0],[0,1,0],[1,1,1]] +**Input:** mat = \[\[0,0,0],[0,1,0],[1,1,1]] **Output:** [[0,0,0],[0,1,0],[1,2,1]] diff --git a/src/main/java/g0501_0600/s0547_number_of_provinces/readme.md b/src/main/java/g0501_0600/s0547_number_of_provinces/readme.md index c1142ed0..efdd001f 100644 --- a/src/main/java/g0501_0600/s0547_number_of_provinces/readme.md +++ b/src/main/java/g0501_0600/s0547_number_of_provinces/readme.md @@ -14,7 +14,7 @@ Return _the total number of **provinces**_. ![](https://assets.leetcode.com/uploads/2020/12/24/graph1.jpg) -**Input:** isConnected = [[1,1,0],[1,1,0],[0,0,1]] +**Input:** isConnected = \[\[1,1,0],[1,1,0],[0,0,1]] **Output:** 2 @@ -22,7 +22,7 @@ Return _the total number of **provinces**_. ![](https://assets.leetcode.com/uploads/2020/12/24/graph2.jpg) -**Input:** isConnected = [[1,0,0],[0,1,0],[0,0,1]] +**Input:** isConnected = \[\[1,0,0],[0,1,0],[0,0,1]] **Output:** 3 diff --git a/src/main/java/g0501_0600/s0554_brick_wall/readme.md b/src/main/java/g0501_0600/s0554_brick_wall/readme.md index 3d206d76..9cf16561 100644 --- a/src/main/java/g0501_0600/s0554_brick_wall/readme.md +++ b/src/main/java/g0501_0600/s0554_brick_wall/readme.md @@ -12,13 +12,13 @@ Given the 2D array `wall` that contains the information about the wall, return _ ![](https://assets.leetcode.com/uploads/2021/04/24/cutwall-grid.jpg) -**Input:** wall = [[1,2,2,1],[3,1,2],[1,3,2],[2,4],[3,1,2],[1,3,1,1]] +**Input:** wall = \[\[1,2,2,1],[3,1,2],[1,3,2],[2,4],[3,1,2],[1,3,1,1]] **Output:** 2 **Example 2:** -**Input:** wall = [[1],[1],[1]] +**Input:** wall = \[\[1],[1],[1]] **Output:** 3 diff --git a/src/main/java/g0501_0600/s0558_logical_or_of_two_binary_grids_represented_as_quad_trees/readme.md b/src/main/java/g0501_0600/s0558_logical_or_of_two_binary_grids_represented_as_quad_trees/readme.md index 08627bc7..0481c73e 100644 --- a/src/main/java/g0501_0600/s0558_logical_or_of_two_binary_grids_represented_as_quad_trees/readme.md +++ b/src/main/java/g0501_0600/s0558_logical_or_of_two_binary_grids_represented_as_quad_trees/readme.md @@ -46,7 +46,7 @@ If the value of `isLeaf` or `val` is True we represent it as **1** in the list ` ![](https://assets.leetcode.com/uploads/2020/02/11/qt1.png) ![](https://assets.leetcode.com/uploads/2020/02/11/qt2.png) -**Input:** quadTree1 = [[0,1],[1,1],[1,1],[1,0],[1,0]] , quadTree2 = [[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]] +**Input:** quadTree1 = \[\[0,1],[1,1],[1,1],[1,0],[1,0]] , quadTree2 = \[\[0,1],[1,1],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]] **Output:** [[0,0],[1,1],[1,1],[1,1],[1,0]] @@ -54,7 +54,7 @@ If the value of `isLeaf` or `val` is True we represent it as **1** in the list ` **Example 2:** -**Input:** quadTree1 = [[1,0]], quadTree2 = [[1,0]] +**Input:** quadTree1 = \[\[1,0]], quadTree2 = \[\[1,0]] **Output:** [[1,0]] diff --git a/src/main/java/g0501_0600/s0566_reshape_the_matrix/readme.md b/src/main/java/g0501_0600/s0566_reshape_the_matrix/readme.md index 1618a08c..c39189d3 100644 --- a/src/main/java/g0501_0600/s0566_reshape_the_matrix/readme.md +++ b/src/main/java/g0501_0600/s0566_reshape_the_matrix/readme.md @@ -14,7 +14,7 @@ If the `reshape` operation with given parameters is possible and legal, output t ![](https://assets.leetcode.com/uploads/2021/04/24/reshape1-grid.jpg) -**Input:** mat = [[1,2],[3,4]], r = 1, c = 4 +**Input:** mat = \[\[1,2],[3,4]], r = 1, c = 4 **Output:** [[1,2,3,4]] @@ -22,7 +22,7 @@ If the `reshape` operation with given parameters is possible and legal, output t ![](https://assets.leetcode.com/uploads/2021/04/24/reshape2-grid.jpg) -**Input:** mat = [[1,2],[3,4]], r = 2, c = 4 +**Input:** mat = \[\[1,2],[3,4]], r = 2, c = 4 **Output:** [[1,2],[3,4]] diff --git a/src/main/java/g0501_0600/s0587_erect_the_fence/readme.md b/src/main/java/g0501_0600/s0587_erect_the_fence/readme.md index ce4bed43..af3270c6 100644 --- a/src/main/java/g0501_0600/s0587_erect_the_fence/readme.md +++ b/src/main/java/g0501_0600/s0587_erect_the_fence/readme.md @@ -12,7 +12,7 @@ Return _the coordinates of trees that are exactly located on the fence perimeter ![](https://assets.leetcode.com/uploads/2021/04/24/erect2-plane.jpg) -**Input:** points = [[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]] +**Input:** points = \[\[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]] **Output:** [[1,1],[2,0],[3,3],[2,4],[4,2]] @@ -20,7 +20,7 @@ Return _the coordinates of trees that are exactly located on the fence perimeter ![](https://assets.leetcode.com/uploads/2021/04/24/erect1-plane.jpg) -**Input:** points = [[1,2],[2,2],[4,2]] +**Input:** points = \[\[1,2],[2,2],[4,2]] **Output:** [[4,2],[2,2],[1,2]] diff --git a/src/main/java/g0501_0600/s0598_range_addition_ii/readme.md b/src/main/java/g0501_0600/s0598_range_addition_ii/readme.md index 9e641d3a..3a7c9941 100644 --- a/src/main/java/g0501_0600/s0598_range_addition_ii/readme.md +++ b/src/main/java/g0501_0600/s0598_range_addition_ii/readme.md @@ -10,7 +10,7 @@ Count and return _the number of maximum integers in the matrix after performing ![](https://assets.leetcode.com/uploads/2020/10/02/ex1.jpg) -**Input:** m = 3, n = 3, ops = [[2,2],[3,3]] +**Input:** m = 3, n = 3, ops = \[\[2,2],[3,3]] **Output:** 4 @@ -18,7 +18,7 @@ Count and return _the number of maximum integers in the matrix after performing **Example 2:** -**Input:** m = 3, n = 3, ops = [[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3]] +**Input:** m = 3, n = 3, ops = \[\[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3],[2,2],[3,3],[3,3],[3,3]] **Output:** 4 diff --git a/src/main/java/g0601_0700/s0630_course_schedule_iii/readme.md b/src/main/java/g0601_0700/s0630_course_schedule_iii/readme.md index ab31ee45..7c4a96bd 100644 --- a/src/main/java/g0601_0700/s0630_course_schedule_iii/readme.md +++ b/src/main/java/g0601_0700/s0630_course_schedule_iii/readme.md @@ -10,19 +10,19 @@ Return _the maximum number of courses that you can take_. **Example 1:** -**Input:** courses = [[100,200],[200,1300],[1000,1250],[2000,3200]] +**Input:** courses = \[\[100,200],[200,1300],[1000,1250],[2000,3200]] **Output:** 3 Explanation: There are totally 4 courses, but you can take 3 courses at most: First, take the 1st course, it costs 100 days so you will finish it on the 100th day, and ready to take the next course on the 101st day. Second, take the 3rd course, it costs 1000 days so you will finish it on the 1100th day, and ready to take the next course on the 1101st day. Third, take the 2nd course, it costs 200 days so you will finish it on the 1300th day. The 4th course cannot be taken now, since you will finish it on the 3300th day, which exceeds the closed date. **Example 2:** -**Input:** courses = [[1,2]] +**Input:** courses = \[\[1,2]] **Output:** 1 **Example 3:** -**Input:** courses = [[3,2],[4,3]] +**Input:** courses = \[\[3,2],[4,3]] **Output:** 0 diff --git a/src/main/java/g0601_0700/s0632_smallest_range_covering_elements_from_k_lists/readme.md b/src/main/java/g0601_0700/s0632_smallest_range_covering_elements_from_k_lists/readme.md index 396d7c46..f757f181 100644 --- a/src/main/java/g0601_0700/s0632_smallest_range_covering_elements_from_k_lists/readme.md +++ b/src/main/java/g0601_0700/s0632_smallest_range_covering_elements_from_k_lists/readme.md @@ -8,7 +8,7 @@ We define the range `[a, b]` is smaller than range `[c, d]` if `b - a < d - c` * **Example 1:** -**Input:** nums = [[4,10,15,24,26],[0,9,12,20],[5,18,22,30]] +**Input:** nums = \[\[4,10,15,24,26],[0,9,12,20],[5,18,22,30]] **Output:** [20,24] @@ -22,7 +22,7 @@ List 3: [5, 18, 22, 30], 22 is in range [20,24]. **Example 2:** -**Input:** nums = [[1,2,3],[1,2,3],[1,2,3]] +**Input:** nums = \[\[1,2,3],[1,2,3],[1,2,3]] **Output:** [1,1] diff --git a/src/main/java/g0601_0700/s0638_shopping_offers/readme.md b/src/main/java/g0601_0700/s0638_shopping_offers/readme.md index 23bbdf20..c6a85358 100644 --- a/src/main/java/g0601_0700/s0638_shopping_offers/readme.md +++ b/src/main/java/g0601_0700/s0638_shopping_offers/readme.md @@ -12,7 +12,7 @@ Return _the lowest price you have to pay for exactly certain items as given, whe **Example 1:** -**Input:** price = [2,5], special = [[3,0,5],[1,2,10]], needs = [3,2] +**Input:** price = [2,5], special = \[\[3,0,5],[1,2,10]], needs = [3,2] **Output:** 14 @@ -26,7 +26,7 @@ You need to buy 3A and 2B, so you may pay $10 for 1A and 2B (special offer #2), **Example 2:** -**Input:** price = [2,3,4], special = [[1,1,0,4],[2,2,1,9]], needs = [1,2,1] +**Input:** price = [2,3,4], special = \[\[1,1,0,4],[2,2,1,9]], needs = [1,2,1] **Output:** 11 diff --git a/src/main/java/g0601_0700/s0646_maximum_length_of_pair_chain/readme.md b/src/main/java/g0601_0700/s0646_maximum_length_of_pair_chain/readme.md index c9cdcb98..cd6a5528 100644 --- a/src/main/java/g0601_0700/s0646_maximum_length_of_pair_chain/readme.md +++ b/src/main/java/g0601_0700/s0646_maximum_length_of_pair_chain/readme.md @@ -12,7 +12,7 @@ You do not need to use up all the given intervals. You can select pairs in any o **Example 1:** -**Input:** pairs = [[1,2],[2,3],[3,4]] +**Input:** pairs = \[\[1,2],[2,3],[3,4]] **Output:** 2 @@ -20,7 +20,7 @@ You do not need to use up all the given intervals. You can select pairs in any o **Example 2:** -**Input:** pairs = [[1,2],[7,8],[4,5]] +**Input:** pairs = \[\[1,2],[7,8],[4,5]] **Output:** 3 diff --git a/src/main/java/g0601_0700/s0661_image_smoother/readme.md b/src/main/java/g0601_0700/s0661_image_smoother/readme.md index 912c71b1..c05ce80a 100644 --- a/src/main/java/g0601_0700/s0661_image_smoother/readme.md +++ b/src/main/java/g0601_0700/s0661_image_smoother/readme.md @@ -12,7 +12,7 @@ Given an `m x n` integer matrix `img` representing the grayscale of an image, re ![](https://assets.leetcode.com/uploads/2021/05/03/smooth-grid.jpg) -**Input:** img = [[1,1,1],[1,0,1],[1,1,1]] +**Input:** img = \[\[1,1,1],[1,0,1],[1,1,1]] **Output:** [[0,0,0],[0,0,0],[0,0,0]] @@ -28,7 +28,7 @@ For the point (1,1): floor(8/9) = floor(0.88888889) = 0 ![](https://assets.leetcode.com/uploads/2021/05/03/smooth2-grid.jpg) -**Input:** img = [[100,200,100],[200,50,200],[100,200,100]] +**Input:** img = \[\[100,200,100],[200,50,200],[100,200,100]] **Output:** [[137,141,137],[141,138,141],[137,141,137]] diff --git a/src/main/java/g0601_0700/s0672_bulb_switcher_ii/readme.md b/src/main/java/g0601_0700/s0672_bulb_switcher_ii/readme.md index a37dba77..698c5757 100644 --- a/src/main/java/g0601_0700/s0672_bulb_switcher_ii/readme.md +++ b/src/main/java/g0601_0700/s0672_bulb_switcher_ii/readme.md @@ -21,9 +21,9 @@ Given the two integers `n` and `presses`, return _the number of **different poss **Explanation:** Status can be: -- [off] by pressing button 1 +- \[off] by pressing button 1 -- [on] by pressing button 2 +- \[on] by pressing button 2 **Example 2:** @@ -33,11 +33,11 @@ Given the two integers `n` and `presses`, return _the number of **different poss **Explanation:** Status can be: -- [off, off] by pressing button 1 +- \[off, off] by pressing button 1 -- [on, off] by pressing button 2 +- \[on, off] by pressing button 2 -- [off, on] by pressing button 3 +- \[off, on] by pressing button 3 **Example 3:** @@ -47,13 +47,13 @@ Given the two integers `n` and `presses`, return _the number of **different poss **Explanation:** Status can be: -- [off, off, off] by pressing button 1 +- \[off, off, off] by pressing button 1 -- [off, on, off] by pressing button 2 +- \[off, on, off] by pressing button 2 -- [on, off, on] by pressing button 3 +- \[on, off, on] by pressing button 3 -- [off, on, on] by pressing button 4 +- \[off, on, on] by pressing button 4 **Constraints:** diff --git a/src/main/java/g0601_0700/s0675_cut_off_trees_for_golf_event/readme.md b/src/main/java/g0601_0700/s0675_cut_off_trees_for_golf_event/readme.md index d3811721..1f919573 100644 --- a/src/main/java/g0601_0700/s0675_cut_off_trees_for_golf_event/readme.md +++ b/src/main/java/g0601_0700/s0675_cut_off_trees_for_golf_event/readme.md @@ -20,7 +20,7 @@ You are guaranteed that no two trees have the same height, and there is at least ![](https://assets.leetcode.com/uploads/2020/11/26/trees1.jpg) -**Input:** forest = [[1,2,3],[0,0,4],[7,6,5]] +**Input:** forest = \[\[1,2,3],[0,0,4],[7,6,5]] **Output:** 6 @@ -30,7 +30,7 @@ You are guaranteed that no two trees have the same height, and there is at least ![](https://assets.leetcode.com/uploads/2020/11/26/trees2.jpg) -**Input:** forest = [[1,2,3],[0,0,0],[7,6,5]] +**Input:** forest = \[\[1,2,3],[0,0,0],[7,6,5]] **Output:** -1 @@ -38,7 +38,7 @@ You are guaranteed that no two trees have the same height, and there is at least **Example 3:** -**Input:** forest = [[2,3,4],[0,0,5],[8,7,6]] +**Input:** forest = \[\[2,3,4],[0,0,5],[8,7,6]] **Output:** 6 diff --git a/src/main/java/g0601_0700/s0684_redundant_connection/readme.md b/src/main/java/g0601_0700/s0684_redundant_connection/readme.md index bacac2e8..43006439 100644 --- a/src/main/java/g0601_0700/s0684_redundant_connection/readme.md +++ b/src/main/java/g0601_0700/s0684_redundant_connection/readme.md @@ -12,7 +12,7 @@ Return _an edge that can be removed so that the resulting graph is a tree of_ `n ![](https://assets.leetcode.com/uploads/2021/05/02/reduntant1-1-graph.jpg) -**Input:** edges = [[1,2],[1,3],[2,3]] +**Input:** edges = \[\[1,2],[1,3],[2,3]] **Output:** [2,3] @@ -20,7 +20,7 @@ Return _an edge that can be removed so that the resulting graph is a tree of_ `n ![](https://assets.leetcode.com/uploads/2021/05/02/reduntant1-2-graph.jpg) -**Input:** edges = [[1,2],[2,3],[3,4],[1,4],[1,5]] +**Input:** edges = \[\[1,2],[2,3],[3,4],[1,4],[1,5]] **Output:** [1,4] diff --git a/src/main/java/g0601_0700/s0685_redundant_connection_ii/readme.md b/src/main/java/g0601_0700/s0685_redundant_connection_ii/readme.md index 85fade77..3f243dcc 100644 --- a/src/main/java/g0601_0700/s0685_redundant_connection_ii/readme.md +++ b/src/main/java/g0601_0700/s0685_redundant_connection_ii/readme.md @@ -14,7 +14,7 @@ Return _an edge that can be removed so that the resulting graph is a rooted tree ![](https://assets.leetcode.com/uploads/2020/12/20/graph1.jpg) -**Input:** edges = [[1,2],[1,3],[2,3]] +**Input:** edges = \[\[1,2],[1,3],[2,3]] **Output:** [2,3] @@ -22,7 +22,7 @@ Return _an edge that can be removed so that the resulting graph is a rooted tree ![](https://assets.leetcode.com/uploads/2020/12/20/graph2.jpg) -**Input:** edges = [[1,2],[2,3],[3,4],[4,1],[1,5]] +**Input:** edges = \[\[1,2],[2,3],[3,4],[4,1],[1,5]] **Output:** [4,1] diff --git a/src/main/java/g0601_0700/s0690_employee_importance/readme.md b/src/main/java/g0601_0700/s0690_employee_importance/readme.md index 664a99e8..966d878d 100644 --- a/src/main/java/g0601_0700/s0690_employee_importance/readme.md +++ b/src/main/java/g0601_0700/s0690_employee_importance/readme.md @@ -16,7 +16,7 @@ Given an integer `id` that represents an employee's ID, return _the **total** im ![](https://assets.leetcode.com/uploads/2021/05/31/emp1-tree.jpg) -**Input:** employees = [[1,5,[2,3]],[2,3,[]],[3,3,[]]], id = 1 +**Input:** employees = \[\[1,5,[2,3]],[2,3,[]],[3,3,[]]], id = 1 **Output:** 11 @@ -32,7 +32,7 @@ Thus, the total importance value of employee 1 is 5 + 3 + 3 = 11. ![](https://assets.leetcode.com/uploads/2021/05/31/emp2-tree.jpg) -**Input:** employees = [[1,2,[5]],[5,-3,[]]], id = 5 +**Input:** employees = \[\[1,2,[5]],[5,-3,[]]], id = 5 **Output:** -3 diff --git a/src/main/java/g0601_0700/s0695_max_area_of_island/readme.md b/src/main/java/g0601_0700/s0695_max_area_of_island/readme.md index fcc2b17e..0e3b93bf 100644 --- a/src/main/java/g0601_0700/s0695_max_area_of_island/readme.md +++ b/src/main/java/g0601_0700/s0695_max_area_of_island/readme.md @@ -12,7 +12,7 @@ Return _the maximum **area** of an island in_ `grid`. If there is no island, ret ![](https://assets.leetcode.com/uploads/2021/05/01/maxarea1-grid.jpg) -**Input:** grid = [[0,0,1,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,1,1,0,1,0,0,0,0,0,0,0,0],[0,1,0,0,1,1,0,0,1,0,1,0,0],[0,1,0,0,1,1,0,0,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,0,0,0,0,0,0,1,1,0,0,0,0]] +**Input:** grid = \[\[0,0,1,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,1,1,0,1,0,0,0,0,0,0,0,0],[0,1,0,0,1,1,0,0,1,0,1,0,0],[0,1,0,0,1,1,0,0,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,1,1,1,0,0,0],[0,0,0,0,0,0,0,1,1,0,0,0,0]] **Output:** 6 @@ -20,7 +20,7 @@ Return _the maximum **area** of an island in_ `grid`. If there is no island, ret **Example 2:** -**Input:** grid = [[0,0,0,0,0,0,0,0]] +**Input:** grid = \[\[0,0,0,0,0,0,0,0]] **Output:** 0 diff --git a/src/main/java/g0601_0700/s0699_falling_squares/readme.md b/src/main/java/g0601_0700/s0699_falling_squares/readme.md index d10828f6..7d58d08a 100644 --- a/src/main/java/g0601_0700/s0699_falling_squares/readme.md +++ b/src/main/java/g0601_0700/s0699_falling_squares/readme.md @@ -16,7 +16,7 @@ Return _an integer array_ `ans` _where_ `ans[i]` _represents the height describe ![](https://assets.leetcode.com/uploads/2021/04/28/fallingsq1-plane.jpg) -**Input:** positions = [[1,2],[2,3],[6,1]] +**Input:** positions = \[\[1,2],[2,3],[6,1]] **Output:** [2,5,5] @@ -32,7 +32,7 @@ Thus, we return an answer of [2, 5, 5]. **Example 2:** -**Input:** positions = [[100,100],[200,100]] +**Input:** positions = \[\[100,100],[200,100]] **Output:** [100,100] diff --git a/src/main/java/g0701_0800/s0733_flood_fill/readme.md b/src/main/java/g0701_0800/s0733_flood_fill/readme.md index 466702ad..b8e0c0e5 100644 --- a/src/main/java/g0701_0800/s0733_flood_fill/readme.md +++ b/src/main/java/g0701_0800/s0733_flood_fill/readme.md @@ -14,7 +14,7 @@ Return _the modified image after performing the flood fill_. ![](https://assets.leetcode.com/uploads/2021/06/01/flood1-grid.jpg) -**Input:** image = [[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, newColor = 2 +**Input:** image = \[\[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, newColor = 2 **Output:** [[2,2,2],[2,2,0],[2,0,1]] @@ -22,7 +22,7 @@ Return _the modified image after performing the flood fill_. **Example 2:** -**Input:** image = [[0,0,0],[0,0,0]], sr = 0, sc = 0, newColor = 2 +**Input:** image = \[\[0,0,0],[0,0,0]], sr = 0, sc = 0, newColor = 2 **Output:** [[2,2,2],[2,2,2]] diff --git a/src/main/java/g0701_0800/s0741_cherry_pickup/readme.md b/src/main/java/g0701_0800/s0741_cherry_pickup/readme.md index 4e588fed..051fea00 100644 --- a/src/main/java/g0701_0800/s0741_cherry_pickup/readme.md +++ b/src/main/java/g0701_0800/s0741_cherry_pickup/readme.md @@ -19,7 +19,7 @@ Return _the maximum number of cherries you can collect by following the rules be ![](https://assets.leetcode.com/uploads/2020/12/14/grid.jpg) -**Input:** grid = [[0,1,-1],[1,0,-1],[1,1,1]] +**Input:** grid = \[\[0,1,-1],[1,0,-1],[1,1,1]] **Output:** 5 @@ -27,7 +27,7 @@ Return _the maximum number of cherries you can collect by following the rules be **Example 2:** -**Input:** grid = [[1,1,-1],[1,-1,1],[-1,1,1]] +**Input:** grid = \[\[1,1,-1],[1,-1,1],[-1,1,1]] **Output:** 0 diff --git a/src/main/java/g0701_0800/s0743_network_delay_time/readme.md b/src/main/java/g0701_0800/s0743_network_delay_time/readme.md index c0f96078..636ec41c 100644 --- a/src/main/java/g0701_0800/s0743_network_delay_time/readme.md +++ b/src/main/java/g0701_0800/s0743_network_delay_time/readme.md @@ -10,19 +10,19 @@ We will send a signal from a given node `k`. Return the time it takes for all th ![](https://assets.leetcode.com/uploads/2019/05/23/931_example_1.png) -**Input:** times = [[2,1,1],[2,3,1],[3,4,1]], n = 4, k = 2 +**Input:** times = \[\[2,1,1],[2,3,1],[3,4,1]], n = 4, k = 2 **Output:** 2 **Example 2:** -**Input:** times = [[1,2,1]], n = 2, k = 1 +**Input:** times = \[\[1,2,1]], n = 2, k = 1 **Output:** 1 **Example 3:** -**Input:** times = [[1,2,1]], n = 2, k = 2 +**Input:** times = \[\[1,2,1]], n = 2, k = 2 **Output:** -1 diff --git a/src/main/java/g0701_0800/s0749_contain_virus/readme.md b/src/main/java/g0701_0800/s0749_contain_virus/readme.md index 85516d37..239be90b 100644 --- a/src/main/java/g0701_0800/s0749_contain_virus/readme.md +++ b/src/main/java/g0701_0800/s0749_contain_virus/readme.md @@ -14,7 +14,7 @@ Return _the number of walls used to quarantine all the infected regions_. If the ![](https://assets.leetcode.com/uploads/2021/06/01/virus11-grid.jpg) -**Input:** isInfected = [[0,1,0,0,0,0,0,1],[0,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,0]] +**Input:** isInfected = \[\[0,1,0,0,0,0,0,1],[0,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,0]] **Output:** 10 @@ -24,7 +24,7 @@ Return _the number of walls used to quarantine all the infected regions_. If the ![](https://assets.leetcode.com/uploads/2021/06/01/virus2-grid.jpg) -**Input:** isInfected = [[1,1,1],[1,0,1],[1,1,1]] +**Input:** isInfected = \[\[1,1,1],[1,0,1],[1,1,1]] **Output:** 4 @@ -32,7 +32,7 @@ Return _the number of walls used to quarantine all the infected regions_. If the **Example 3:** -**Input:** isInfected = [[1,1,1,0,0,0,0,0,0],[1,0,1,0,1,1,1,1,1],[1,1,1,0,0,0,0,0,0]] +**Input:** isInfected = \[\[1,1,1,0,0,0,0,0,0],[1,0,1,0,1,1,1,1,1],[1,1,1,0,0,0,0,0,0]] **Output:** 13 diff --git a/src/main/java/g0701_0800/s0757_set_intersection_size_at_least_two/readme.md b/src/main/java/g0701_0800/s0757_set_intersection_size_at_least_two/readme.md index fa3d60ed..a178dbd9 100644 --- a/src/main/java/g0701_0800/s0757_set_intersection_size_at_least_two/readme.md +++ b/src/main/java/g0701_0800/s0757_set_intersection_size_at_least_two/readme.md @@ -8,7 +8,7 @@ Find the minimum size of a set S such that for every integer interval A in `inte **Example 1:** -**Input:** intervals = [[1,3],[1,4],[2,5],[3,5]] +**Input:** intervals = \[\[1,3],[1,4],[2,5],[3,5]] **Output:** 3 @@ -20,7 +20,7 @@ Find the minimum size of a set S such that for every integer interval A in `inte **Example 2:** -**Input:** intervals = [[1,2],[2,3],[2,4],[4,5]] +**Input:** intervals = \[\[1,2],[2,3],[2,4],[4,5]] **Output:** 5 diff --git a/src/main/java/g0701_0800/s0764_largest_plus_sign/readme.md b/src/main/java/g0701_0800/s0764_largest_plus_sign/readme.md index 2d0b51da..1605290f 100644 --- a/src/main/java/g0701_0800/s0764_largest_plus_sign/readme.md +++ b/src/main/java/g0701_0800/s0764_largest_plus_sign/readme.md @@ -12,7 +12,7 @@ An **axis-aligned plus sign** of `1`'s of order `k` has some center `grid[r][c] ![](https://assets.leetcode.com/uploads/2021/06/13/plus1-grid.jpg) -**Input:** n = 5, mines = [[4,2]] +**Input:** n = 5, mines = \[\[4,2]] **Output:** 2 @@ -22,7 +22,7 @@ An **axis-aligned plus sign** of `1`'s of order `k` has some center `grid[r][c] ![](https://assets.leetcode.com/uploads/2021/06/13/plus2-grid.jpg) -**Input:** n = 1, mines = [[0,0]] +**Input:** n = 1, mines = \[\[0,0]] **Output:** 0 diff --git a/src/main/java/g0701_0800/s0766_toeplitz_matrix/readme.md b/src/main/java/g0701_0800/s0766_toeplitz_matrix/readme.md index 9ddd0cdf..d6126712 100644 --- a/src/main/java/g0701_0800/s0766_toeplitz_matrix/readme.md +++ b/src/main/java/g0701_0800/s0766_toeplitz_matrix/readme.md @@ -10,7 +10,7 @@ A matrix is **Toeplitz** if every diagonal from top-left to bottom-right has the ![](https://assets.leetcode.com/uploads/2020/11/04/ex1.jpg) -**Input:** matrix = [[1,2,3,4],[5,1,2,3],[9,5,1,2]] +**Input:** matrix = \[\[1,2,3,4],[5,1,2,3],[9,5,1,2]] **Output:** true @@ -20,7 +20,7 @@ A matrix is **Toeplitz** if every diagonal from top-left to bottom-right has the ![](https://assets.leetcode.com/uploads/2020/11/04/ex2.jpg) -**Input:** matrix = [[1,2],[2,2]] +**Input:** matrix = \[\[1,2],[2,2]] **Output:** false diff --git a/src/main/java/g0701_0800/s0773_sliding_puzzle/readme.md b/src/main/java/g0701_0800/s0773_sliding_puzzle/readme.md index 91c4e06c..d8c95294 100644 --- a/src/main/java/g0701_0800/s0773_sliding_puzzle/readme.md +++ b/src/main/java/g0701_0800/s0773_sliding_puzzle/readme.md @@ -12,7 +12,7 @@ Given the puzzle board `board`, return _the least number of moves required so th ![](https://assets.leetcode.com/uploads/2021/06/29/slide1-grid.jpg) -**Input:** board = [[1,2,3],[4,0,5]] +**Input:** board = \[\[1,2,3],[4,0,5]] **Output:** 1 @@ -22,7 +22,7 @@ Given the puzzle board `board`, return _the least number of moves required so th ![](https://assets.leetcode.com/uploads/2021/06/29/slide2-grid.jpg) -**Input:** board = [[1,2,3],[5,4,0]] +**Input:** board = \[\[1,2,3],[5,4,0]] **Output:** -1 @@ -32,7 +32,7 @@ Given the puzzle board `board`, return _the least number of moves required so th ![](https://assets.leetcode.com/uploads/2021/06/29/slide3-grid.jpg) -**Input:** board = [[4,1,2],[5,0,3]] +**Input:** board = \[\[4,1,2],[5,0,3]] **Output:** 5 diff --git a/src/main/java/g0701_0800/s0778_swim_in_rising_water/readme.md b/src/main/java/g0701_0800/s0778_swim_in_rising_water/readme.md index 31306c43..8a39e890 100644 --- a/src/main/java/g0701_0800/s0778_swim_in_rising_water/readme.md +++ b/src/main/java/g0701_0800/s0778_swim_in_rising_water/readme.md @@ -12,7 +12,7 @@ Return _the least time until you can reach the bottom right square_ `(n - 1, n - ![](https://assets.leetcode.com/uploads/2021/06/29/swim1-grid.jpg) -**Input:** grid = [[0,2],[1,3]] +**Input:** grid = \[\[0,2],[1,3]] **Output:** 3 @@ -27,7 +27,7 @@ Return _the least time until you can reach the bottom right square_ `(n - 1, n - ![](https://assets.leetcode.com/uploads/2021/06/29/swim2-grid-1.jpg) -**Input:** grid = [[0,1,2,3,4],[24,23,22,21,5],[12,13,14,15,16],[11,17,18,19,20],[10,9,8,7,6]] +**Input:** grid = \[\[0,1,2,3,4],[24,23,22,21,5],[12,13,14,15,16],[11,17,18,19,20],[10,9,8,7,6]] **Output:** 16 diff --git a/src/main/java/g0701_0800/s0782_transform_to_chessboard/readme.md b/src/main/java/g0701_0800/s0782_transform_to_chessboard/readme.md index 1c78fc0d..c0e881ea 100644 --- a/src/main/java/g0701_0800/s0782_transform_to_chessboard/readme.md +++ b/src/main/java/g0701_0800/s0782_transform_to_chessboard/readme.md @@ -12,7 +12,7 @@ A **chessboard board** is a board where no `0`'s and no `1`'s are 4-directionall ![](https://assets.leetcode.com/uploads/2021/06/29/chessboard1-grid.jpg) -**Input:** board = [[0,1,1,0],[0,1,1,0],[1,0,0,1],[1,0,0,1]] +**Input:** board = \[\[0,1,1,0],[0,1,1,0],[1,0,0,1],[1,0,0,1]] **Output:** 2 @@ -26,7 +26,7 @@ A **chessboard board** is a board where no `0`'s and no `1`'s are 4-directionall ![](https://assets.leetcode.com/uploads/2021/06/29/chessboard2-grid.jpg) -**Input:** board = [[0,1],[1,0]] +**Input:** board = \[\[0,1],[1,0]] **Output:** 0 @@ -36,7 +36,7 @@ A **chessboard board** is a board where no `0`'s and no `1`'s are 4-directionall ![](https://assets.leetcode.com/uploads/2021/06/29/chessboard3-grid.jpg) -**Input:** board = [[1,0],[1,0]] +**Input:** board = \[\[1,0],[1,0]] **Output:** -1 diff --git a/src/main/java/g0701_0800/s0785_is_graph_bipartite/readme.md b/src/main/java/g0701_0800/s0785_is_graph_bipartite/readme.md index 8920c992..03359c05 100644 --- a/src/main/java/g0701_0800/s0785_is_graph_bipartite/readme.md +++ b/src/main/java/g0701_0800/s0785_is_graph_bipartite/readme.md @@ -17,7 +17,7 @@ Return `true` _if and only if it is **bipartite**_. ![](https://assets.leetcode.com/uploads/2020/10/21/bi2.jpg) -**Input:** graph = [[1,2,3],[0,2],[0,1,3],[0,2]] +**Input:** graph = \[\[1,2,3],[0,2],[0,1,3],[0,2]] **Output:** false @@ -27,7 +27,7 @@ Return `true` _if and only if it is **bipartite**_. ![](https://assets.leetcode.com/uploads/2020/10/21/bi1.jpg) -**Input:** graph = [[1,3],[0,2],[1,3],[0,2]] +**Input:** graph = \[\[1,3],[0,2],[1,3],[0,2]] **Output:** true diff --git a/src/main/java/g0701_0800/s0787_cheapest_flights_within_k_stops/readme.md b/src/main/java/g0701_0800/s0787_cheapest_flights_within_k_stops/readme.md index 28091db9..9b23bf09 100644 --- a/src/main/java/g0701_0800/s0787_cheapest_flights_within_k_stops/readme.md +++ b/src/main/java/g0701_0800/s0787_cheapest_flights_within_k_stops/readme.md @@ -10,7 +10,7 @@ You are also given three integers `src`, `dst`, and `k`, return _**the cheapest ![](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/02/16/995.png) -**Input:** n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 1 +**Input:** n = 3, flights = \[\[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 1 **Output:** 200 @@ -24,7 +24,7 @@ The cheapest price from city `0` to city `2` with at most 1 stop costs 200, as m ![](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/02/16/995.png) -**Input:** n = 3, flights = [[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 0 +**Input:** n = 3, flights = \[\[0,1,100],[1,2,100],[0,2,500]], src = 0, dst = 2, k = 0 **Output:** 500 diff --git a/src/main/java/g0701_0800/s0789_escape_the_ghosts/readme.md b/src/main/java/g0701_0800/s0789_escape_the_ghosts/readme.md index 13d6a4fc..fb2274ed 100644 --- a/src/main/java/g0701_0800/s0789_escape_the_ghosts/readme.md +++ b/src/main/java/g0701_0800/s0789_escape_the_ghosts/readme.md @@ -12,7 +12,7 @@ Return `true` _if it is possible to escape regardless of how the ghosts move, ot **Example 1:** -**Input:** ghosts = [[1,0],[0,3]], target = [0,1] +**Input:** ghosts = \[\[1,0],[0,3]], target = [0,1] **Output:** true @@ -20,7 +20,7 @@ Return `true` _if it is possible to escape regardless of how the ghosts move, ot **Example 2:** -**Input:** ghosts = [[1,0]], target = [2,0] +**Input:** ghosts = \[\[1,0]], target = [2,0] **Output:** false @@ -28,7 +28,7 @@ Return `true` _if it is possible to escape regardless of how the ghosts move, ot **Example 3:** -**Input:** ghosts = [[2,0]], target = [1,0] +**Input:** ghosts = \[\[2,0]], target = [1,0] **Output:** false diff --git a/src/main/java/g0701_0800/s0797_all_paths_from_source_to_target/readme.md b/src/main/java/g0701_0800/s0797_all_paths_from_source_to_target/readme.md index f243f0a3..8d524821 100644 --- a/src/main/java/g0701_0800/s0797_all_paths_from_source_to_target/readme.md +++ b/src/main/java/g0701_0800/s0797_all_paths_from_source_to_target/readme.md @@ -10,7 +10,7 @@ The graph is given as follows: `graph[i]` is a list of all nodes you can visit f ![](https://assets.leetcode.com/uploads/2020/09/28/all_1.jpg) -**Input:** graph = [[1,2],[3],[3],[]] +**Input:** graph = \[\[1,2],[3],[3],[]] **Output:** [[0,1,3],[0,2,3]] @@ -20,7 +20,7 @@ The graph is given as follows: `graph[i]` is a list of all nodes you can visit f ![](https://assets.leetcode.com/uploads/2020/09/28/all_2.jpg) -**Input:** graph = [[4,3,1],[3,2,4],[3],[4],[]] +**Input:** graph = \[\[4,3,1],[3,2,4],[3],[4],[]] **Output:** [[0,4],[0,3,4],[0,1,3,4],[0,1,2,3,4],[0,1,4]] diff --git a/src/main/java/g0801_0900/s0802_find_eventual_safe_states/readme.md b/src/main/java/g0801_0900/s0802_find_eventual_safe_states/readme.md index aab6d813..b0b04f77 100644 --- a/src/main/java/g0801_0900/s0802_find_eventual_safe_states/readme.md +++ b/src/main/java/g0801_0900/s0802_find_eventual_safe_states/readme.md @@ -12,7 +12,7 @@ Return _an array containing all the **safe nodes** of the graph_. The answer sho ![Illustration of graph](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/03/17/picture1.png) -**Input:** graph = [[1,2],[2,3],[5],[0],[5],[],[]] +**Input:** graph = \[\[1,2],[2,3],[5],[0],[5],[],[]] **Output:** [2,4,5,6] @@ -24,7 +24,7 @@ Every path starting at nodes 2, 4, 5, and 6 all lead to either node 5 or 6. **Example 2:** -**Input:** graph = [[1,2,3,4],[1,2],[3,4],[0,4],[]] +**Input:** graph = \[\[1,2,3,4],[1,2],[3,4],[0,4],[]] **Output:** [4] diff --git a/src/main/java/g0801_0900/s0803_bricks_falling_when_hit/readme.md b/src/main/java/g0801_0900/s0803_bricks_falling_when_hit/readme.md index 5a7a96fe..ae9c1da4 100644 --- a/src/main/java/g0801_0900/s0803_bricks_falling_when_hit/readme.md +++ b/src/main/java/g0801_0900/s0803_bricks_falling_when_hit/readme.md @@ -15,7 +15,7 @@ Return _an array_ `result`_, where each_ `result[i]` _is the number of bricks th **Example 1:** -**Input:** grid = [[1,0,0,0],[1,1,1,0]], hits = [[1,0]] +**Input:** grid = \[\[1,0,0,0],[1,1,1,0]], hits = \[\[1,0]] **Output:** [2] @@ -35,7 +35,7 @@ Hence the result is [2]. **Example 2:** -**Input:** grid = [[1,0,0,0],[1,1,0,0]], hits = [[1,1],[1,0]] +**Input:** grid = \[\[1,0,0,0],[1,1,0,0]], hits = \[\[1,1],[1,0]] **Output:** [0,0] diff --git a/src/main/java/g0801_0900/s0807_max_increase_to_keep_city_skyline/readme.md b/src/main/java/g0801_0900/s0807_max_increase_to_keep_city_skyline/readme.md index c3e72629..e1b513f8 100644 --- a/src/main/java/g0801_0900/s0807_max_increase_to_keep_city_skyline/readme.md +++ b/src/main/java/g0801_0900/s0807_max_increase_to_keep_city_skyline/readme.md @@ -14,7 +14,7 @@ Return _the **maximum total sum** that the height of the buildings can be increa ![](https://assets.leetcode.com/uploads/2021/06/21/807-ex1.png) -**Input:** grid = [[3,0,8,4],[2,4,5,7],[9,2,6,3],[0,3,1,0]] +**Input:** grid = \[\[3,0,8,4],[2,4,5,7],[9,2,6,3],[0,3,1,0]] **Output:** 35 @@ -31,7 +31,7 @@ The grid after increasing the height of buildings without affecting skylines is: **Example 2:** -**Input:** grid = [[0,0,0],[0,0,0],[0,0,0]] +**Input:** grid = \[\[0,0,0],[0,0,0],[0,0,0]] **Output:** 0 diff --git a/src/main/java/g0801_0900/s0812_largest_triangle_area/readme.md b/src/main/java/g0801_0900/s0812_largest_triangle_area/readme.md index 3dd8c7f7..5aaa58c7 100644 --- a/src/main/java/g0801_0900/s0812_largest_triangle_area/readme.md +++ b/src/main/java/g0801_0900/s0812_largest_triangle_area/readme.md @@ -8,7 +8,7 @@ Given an array of points on the **X-Y** plane `points` where points[i] = [ ![](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/04/04/1027.png) -**Input:** points = [[0,0],[0,1],[1,0],[0,2],[2,0]] +**Input:** points = \[\[0,0],[0,1],[1,0],[0,2],[2,0]] **Output:** 2.00000 @@ -16,7 +16,7 @@ Given an array of points on the **X-Y** plane `points` where points[i] = [ **Example 2:** -**Input:** points = [[1,0],[0,0],[0,1]] +**Input:** points = \[\[1,0],[0,0],[0,1]] **Output:** 0.50000 diff --git a/src/main/java/g0801_0900/s0815_bus_routes/readme.md b/src/main/java/g0801_0900/s0815_bus_routes/readme.md index a4c38785..31c02d79 100644 --- a/src/main/java/g0801_0900/s0815_bus_routes/readme.md +++ b/src/main/java/g0801_0900/s0815_bus_routes/readme.md @@ -12,7 +12,7 @@ Return _the least number of buses you must take to travel from_ `source` _to_ `t **Example 1:** -**Input:** routes = [[1,2,7],[3,6,7]], source = 1, target = 6 +**Input:** routes = \[\[1,2,7],[3,6,7]], source = 1, target = 6 **Output:** 2 @@ -20,7 +20,7 @@ Return _the least number of buses you must take to travel from_ `source` _to_ `t **Example 2:** -**Input:** routes = [[7,12],[4,5,15],[6],[15,19],[9,12,13]], source = 15, target = 12 +**Input:** routes = \[\[7,12],[4,5,15],[6],[15,19],[9,12,13]], source = 15, target = 12 **Output:** -1 diff --git a/src/main/java/g0801_0900/s0827_making_a_large_island/readme.md b/src/main/java/g0801_0900/s0827_making_a_large_island/readme.md index 5ac15cb5..8f93806d 100644 --- a/src/main/java/g0801_0900/s0827_making_a_large_island/readme.md +++ b/src/main/java/g0801_0900/s0827_making_a_large_island/readme.md @@ -10,7 +10,7 @@ An **island** is a 4-directionally connected group of `1`s. **Example 1:** -**Input:** grid = [[1,0],[0,1]] +**Input:** grid = \[\[1,0],[0,1]] **Output:** 3 @@ -18,7 +18,7 @@ An **island** is a 4-directionally connected group of `1`s. **Example 2:** -**Input:** grid = [[1,1],[1,0]] +**Input:** grid = \[\[1,1],[1,0]] **Output:** 4 @@ -26,7 +26,7 @@ An **island** is a 4-directionally connected group of `1`s. **Example 3:** -**Input:** grid = [[1,1],[1,1]] +**Input:** grid = \[\[1,1],[1,1]] **Output:** 4 diff --git a/src/main/java/g0801_0900/s0832_flipping_an_image/readme.md b/src/main/java/g0801_0900/s0832_flipping_an_image/readme.md index d71c4e89..3c0e2233 100644 --- a/src/main/java/g0801_0900/s0832_flipping_an_image/readme.md +++ b/src/main/java/g0801_0900/s0832_flipping_an_image/readme.md @@ -14,7 +14,7 @@ To invert an image means that each `0` is replaced by `1`, and each `1` is repla **Example 1:** -**Input:** image = [[1,1,0],[1,0,1],[0,0,0]] +**Input:** image = \[\[1,1,0],[1,0,1],[0,0,0]] **Output:** [[1,0,0],[0,1,0],[1,1,1]] @@ -26,7 +26,7 @@ Then, invert the image: [[1,0,0],[0,1,0],[1,1,1]] **Example 2:** -**Input:** image = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]] +**Input:** image = \[\[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]] **Output:** [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]] diff --git a/src/main/java/g0801_0900/s0834_sum_of_distances_in_tree/readme.md b/src/main/java/g0801_0900/s0834_sum_of_distances_in_tree/readme.md index 38f995fe..de500a36 100644 --- a/src/main/java/g0801_0900/s0834_sum_of_distances_in_tree/readme.md +++ b/src/main/java/g0801_0900/s0834_sum_of_distances_in_tree/readme.md @@ -12,7 +12,7 @@ Return an array `answer` of length `n` where `answer[i]` is the sum of the dista ![](https://assets.leetcode.com/uploads/2021/07/23/lc-sumdist1.jpg) -**Input:** n = 6, edges = [[0,1],[0,2],[2,3],[2,4],[2,5]] +**Input:** n = 6, edges = \[\[0,1],[0,2],[2,3],[2,4],[2,5]] **Output:** [8,12,6,10,10,10] @@ -34,7 +34,7 @@ Hence, answer[0] = 8, and so on. ![](https://assets.leetcode.com/uploads/2021/07/23/lc-sumdist3.jpg) -**Input:** n = 2, edges = [[1,0]] +**Input:** n = 2, edges = \[\[1,0]] **Output:** [1,1] diff --git a/src/main/java/g0801_0900/s0835_image_overlap/readme.md b/src/main/java/g0801_0900/s0835_image_overlap/readme.md index 8aad18a6..ea06204d 100644 --- a/src/main/java/g0801_0900/s0835_image_overlap/readme.md +++ b/src/main/java/g0801_0900/s0835_image_overlap/readme.md @@ -14,7 +14,7 @@ Return _the largest possible overlap_. ![](https://assets.leetcode.com/uploads/2020/09/09/overlap1.jpg) -**Input:** img1 = [[1,1,0],[0,1,0],[0,1,0]], img2 = [[0,0,0],[0,1,1],[0,0,1]] +**Input:** img1 = \[\[1,1,0],[0,1,0],[0,1,0]], img2 = \[\[0,0,0],[0,1,1],[0,0,1]] **Output:** 3 @@ -22,13 +22,13 @@ Return _the largest possible overlap_. **Example 2:** -**Input:** img1 = [[1]], img2 = [[1]] +**Input:** img1 = \[\[1]], img2 = \[\[1]] **Output:** 1 **Example 3:** -**Input:** img1 = [[0]], img2 = [[0]] +**Input:** img1 = \[\[0]], img2 = \[\[0]] **Output:** 0 diff --git a/src/main/java/g0801_0900/s0840_magic_squares_in_grid/readme.md b/src/main/java/g0801_0900/s0840_magic_squares_in_grid/readme.md index b635ba2f..fc61c247 100644 --- a/src/main/java/g0801_0900/s0840_magic_squares_in_grid/readme.md +++ b/src/main/java/g0801_0900/s0840_magic_squares_in_grid/readme.md @@ -10,7 +10,7 @@ Given a `row x col` `grid` of integers, how many `3 x 3` "magic square" subgrids ![](https://assets.leetcode.com/uploads/2020/09/11/magic_main.jpg) -**Input:** grid = [[4,3,8,4],[9,5,1,9],[2,7,6,2]] +**Input:** grid = \[\[4,3,8,4],[9,5,1,9],[2,7,6,2]] **Output:** 1 @@ -18,7 +18,7 @@ Given a `row x col` `grid` of integers, how many `3 x 3` "magic square" subgrids **Example 2:** -**Input:** grid = [[8]] +**Input:** grid = \[\[8]] **Output:** 0 diff --git a/src/main/java/g0801_0900/s0841_keys_and_rooms/readme.md b/src/main/java/g0801_0900/s0841_keys_and_rooms/readme.md index 79e8579f..6ef920b3 100644 --- a/src/main/java/g0801_0900/s0841_keys_and_rooms/readme.md +++ b/src/main/java/g0801_0900/s0841_keys_and_rooms/readme.md @@ -10,7 +10,7 @@ Given an array `rooms` where `rooms[i]` is the set of keys that you can obtain i **Example 1:** -**Input:** rooms = [[1],[2],[3],[]] +**Input:** rooms = \[\[1],[2],[3],[]] **Output:** true @@ -18,7 +18,7 @@ Given an array `rooms` where `rooms[i]` is the set of keys that you can obtain i **Example 2:** -**Input:** rooms = [[1,3],[3,0,1],[2],[0]] +**Input:** rooms = \[\[1,3],[3,0,1],[2],[0]] **Output:** false diff --git a/src/main/java/g0801_0900/s0847_shortest_path_visiting_all_nodes/readme.md b/src/main/java/g0801_0900/s0847_shortest_path_visiting_all_nodes/readme.md index d6cfcad7..8a30a99d 100644 --- a/src/main/java/g0801_0900/s0847_shortest_path_visiting_all_nodes/readme.md +++ b/src/main/java/g0801_0900/s0847_shortest_path_visiting_all_nodes/readme.md @@ -10,7 +10,7 @@ Return _the length of the shortest path that visits every node_. You may start a ![](https://assets.leetcode.com/uploads/2021/05/12/shortest1-graph.jpg) -**Input:** graph = [[1,2,3],[0],[0],[0]] +**Input:** graph = \[\[1,2,3],[0],[0],[0]] **Output:** 4 @@ -20,7 +20,7 @@ Return _the length of the shortest path that visits every node_. You may start a ![](https://assets.leetcode.com/uploads/2021/05/12/shortest2-graph.jpg) -**Input:** graph = [[1],[0,2,4],[1,3,4],[2],[1,2]] +**Input:** graph = \[\[1],[0,2,4],[1,3,4],[2],[1,2]] **Output:** 4 diff --git a/src/main/java/g0801_0900/s0850_rectangle_area_ii/readme.md b/src/main/java/g0801_0900/s0850_rectangle_area_ii/readme.md index 69779445..c050a4ca 100644 --- a/src/main/java/g0801_0900/s0850_rectangle_area_ii/readme.md +++ b/src/main/java/g0801_0900/s0850_rectangle_area_ii/readme.md @@ -12,7 +12,7 @@ Return _the **total area**_. Since the answer may be too large, return it **modu ![](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/06/06/rectangle_area_ii_pic.png) -**Input:** rectangles = [[0,0,2,2],[1,0,2,3],[1,0,3,1]] +**Input:** rectangles = \[\[0,0,2,2],[1,0,2,3],[1,0,3,1]] **Output:** 6 @@ -24,7 +24,7 @@ From (1,0) to (2,3), all three rectangles overlap. **Example 2:** -**Input:** rectangles = [[0,0,1000000000,1000000000]] +**Input:** rectangles = \[\[0,0,1000000000,1000000000]] **Output:** 49 diff --git a/src/main/java/g0801_0900/s0851_loud_and_rich/readme.md b/src/main/java/g0801_0900/s0851_loud_and_rich/readme.md index 52bd1617..15258a18 100644 --- a/src/main/java/g0801_0900/s0851_loud_and_rich/readme.md +++ b/src/main/java/g0801_0900/s0851_loud_and_rich/readme.md @@ -10,7 +10,7 @@ Return _an integer array_ `answer` _where_ `answer[x] = y` _if_ `y` _is the leas **Example 1:** -**Input:** richer = [[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]], quiet = [3,2,5,4,6,1,7,0] +**Input:** richer = \[\[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]], quiet = [3,2,5,4,6,1,7,0] **Output:** [5,5,2,5,4,5,6,7] diff --git a/src/main/java/g0801_0900/s0861_score_after_flipping_matrix/readme.md b/src/main/java/g0801_0900/s0861_score_after_flipping_matrix/readme.md index 362c1809..770c96a5 100644 --- a/src/main/java/g0801_0900/s0861_score_after_flipping_matrix/readme.md +++ b/src/main/java/g0801_0900/s0861_score_after_flipping_matrix/readme.md @@ -14,7 +14,7 @@ Return _the highest possible **score** after making any number of **moves** (inc ![](https://assets.leetcode.com/uploads/2021/07/23/lc-toogle1.jpg) -**Input:** grid = [[0,0,1,1],[1,0,1,0],[1,1,0,0]] +**Input:** grid = \[\[0,0,1,1],[1,0,1,0],[1,1,0,0]] **Output:** 39 @@ -22,7 +22,7 @@ Return _the highest possible **score** after making any number of **moves** (inc **Example 2:** -**Input:** grid = [[0]] +**Input:** grid = \[\[0]] **Output:** 1 diff --git a/src/main/java/g0801_0900/s0867_transpose_matrix/readme.md b/src/main/java/g0801_0900/s0867_transpose_matrix/readme.md index c67bae77..b0653683 100644 --- a/src/main/java/g0801_0900/s0867_transpose_matrix/readme.md +++ b/src/main/java/g0801_0900/s0867_transpose_matrix/readme.md @@ -10,13 +10,13 @@ The **transpose** of a matrix is the matrix flipped over its main diagonal, swit **Example 1:** -**Input:** matrix = [[1,2,3],[4,5,6],[7,8,9]] +**Input:** matrix = \[\[1,2,3],[4,5,6],[7,8,9]] **Output:** [[1,4,7],[2,5,8],[3,6,9]] **Example 2:** -**Input:** matrix = [[1,2,3],[4,5,6]] +**Input:** matrix = \[\[1,2,3],[4,5,6]] **Output:** [[1,4],[2,5],[3,6]] diff --git a/src/main/java/g0801_0900/s0871_minimum_number_of_refueling_stops/readme.md b/src/main/java/g0801_0900/s0871_minimum_number_of_refueling_stops/readme.md index 15f20ba4..b62cf586 100644 --- a/src/main/java/g0801_0900/s0871_minimum_number_of_refueling_stops/readme.md +++ b/src/main/java/g0801_0900/s0871_minimum_number_of_refueling_stops/readme.md @@ -22,7 +22,7 @@ Note that if the car reaches a gas station with `0` fuel left, the car can still **Example 2:** -**Input:** target = 100, startFuel = 1, stations = [[10,100]] +**Input:** target = 100, startFuel = 1, stations = \[\[10,100]] **Output:** -1 @@ -30,7 +30,7 @@ Note that if the car reaches a gas station with `0` fuel left, the car can still **Example 3:** -**Input:** target = 100, startFuel = 10, stations = [[10,60],[20,30],[30,30],[60,40]] +**Input:** target = 100, startFuel = 10, stations = \[\[10,60],[20,30],[30,30],[60,40]] **Output:** 2 diff --git a/src/main/java/g0801_0900/s0874_walking_robot_simulation/readme.md b/src/main/java/g0801_0900/s0874_walking_robot_simulation/readme.md index b685d5b3..ca007080 100644 --- a/src/main/java/g0801_0900/s0874_walking_robot_simulation/readme.md +++ b/src/main/java/g0801_0900/s0874_walking_robot_simulation/readme.md @@ -39,7 +39,7 @@ The furthest point the robot ever gets from the origin is (3, 4), which squared **Example 2:** -**Input:** commands = [4,-1,4,-2,4], obstacles = [[2,4]] +**Input:** commands = [4,-1,4,-2,4], obstacles = \[\[2,4]] **Output:** 65 diff --git a/src/main/java/g0801_0900/s0882_reachable_nodes_in_subdivided_graph/readme.md b/src/main/java/g0801_0900/s0882_reachable_nodes_in_subdivided_graph/readme.md index 476a6a98..a83d9282 100644 --- a/src/main/java/g0801_0900/s0882_reachable_nodes_in_subdivided_graph/readme.md +++ b/src/main/java/g0801_0900/s0882_reachable_nodes_in_subdivided_graph/readme.md @@ -16,7 +16,7 @@ Given the original graph and `maxMoves`, return _the number of nodes that are ** ![](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/08/01/origfinal.png) -**Input:** edges = [[0,1,10],[0,2,1],[1,2,2]], maxMoves = 6, n = 3 +**Input:** edges = \[\[0,1,10],[0,2,1],[1,2,2]], maxMoves = 6, n = 3 **Output:** 13 @@ -24,13 +24,13 @@ Given the original graph and `maxMoves`, return _the number of nodes that are ** **Example 2:** -**Input:** edges = [[0,1,4],[1,2,6],[0,2,8],[1,3,1]], maxMoves = 10, n = 4 +**Input:** edges = \[\[0,1,4],[1,2,6],[0,2,8],[1,3,1]], maxMoves = 10, n = 4 **Output:** 23 **Example 3:** -**Input:** edges = [[1,2,4],[1,4,5],[1,3,1],[2,3,4],[3,4,5]], maxMoves = 17, n = 5 +**Input:** edges = \[\[1,2,4],[1,4,5],[1,3,1],[2,3,4],[3,4,5]], maxMoves = 17, n = 5 **Output:** 1 diff --git a/src/main/java/g0801_0900/s0883_projection_area_of_3d_shapes/readme.md b/src/main/java/g0801_0900/s0883_projection_area_of_3d_shapes/readme.md index d585ea71..81f9d03e 100644 --- a/src/main/java/g0801_0900/s0883_projection_area_of_3d_shapes/readme.md +++ b/src/main/java/g0801_0900/s0883_projection_area_of_3d_shapes/readme.md @@ -16,7 +16,7 @@ Return _the total area of all three projections_. ![](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/08/02/shadow.png) -**Input:** grid = [[1,2],[3,4]] +**Input:** grid = \[\[1,2],[3,4]] **Output:** 17 @@ -24,13 +24,13 @@ Return _the total area of all three projections_. **Example 2:** -**Input:** grid = [[2]] +**Input:** grid = \[\[2]] **Output:** 5 **Example 3:** -**Input:** grid = [[1,0],[0,2]] +**Input:** grid = \[\[1,0],[0,2]] **Output:** 8 diff --git a/src/main/java/g0801_0900/s0886_possible_bipartition/readme.md b/src/main/java/g0801_0900/s0886_possible_bipartition/readme.md index 2067e41f..f063e45e 100644 --- a/src/main/java/g0801_0900/s0886_possible_bipartition/readme.md +++ b/src/main/java/g0801_0900/s0886_possible_bipartition/readme.md @@ -8,7 +8,7 @@ Given the integer `n` and the array `dislikes` where dislikes[i] = [a **Example 1:** -**Input:** n = 4, dislikes = [[1,2],[1,3],[2,4]] +**Input:** n = 4, dislikes = \[\[1,2],[1,3],[2,4]] **Output:** true @@ -16,13 +16,13 @@ Given the integer `n` and the array `dislikes` where dislikes[i] = [a **Example 2:** -**Input:** n = 3, dislikes = [[1,2],[1,3],[2,3]] +**Input:** n = 3, dislikes = \[\[1,2],[1,3],[2,3]] **Output:** false **Example 3:** -**Input:** n = 5, dislikes = [[1,2],[2,3],[3,4],[4,5],[1,5]] +**Input:** n = 5, dislikes = \[\[1,2],[2,3],[3,4],[4,5],[1,5]] **Output:** false diff --git a/src/main/java/g0801_0900/s0892_surface_area_of_3d_shapes/readme.md b/src/main/java/g0801_0900/s0892_surface_area_of_3d_shapes/readme.md index 5d522a76..f2558864 100644 --- a/src/main/java/g0801_0900/s0892_surface_area_of_3d_shapes/readme.md +++ b/src/main/java/g0801_0900/s0892_surface_area_of_3d_shapes/readme.md @@ -14,7 +14,7 @@ Return _the total surface area of the resulting shapes_. ![](https://assets.leetcode.com/uploads/2021/01/08/tmp-grid2.jpg) -**Input:** grid = [[1,2],[3,4]] +**Input:** grid = \[\[1,2],[3,4]] **Output:** 34 @@ -22,7 +22,7 @@ Return _the total surface area of the resulting shapes_. ![](https://assets.leetcode.com/uploads/2021/01/08/tmp-grid4.jpg) -**Input:** grid = [[1,1,1],[1,0,1],[1,1,1]] +**Input:** grid = \[\[1,1,1],[1,0,1],[1,1,1]] **Output:** 32 @@ -30,7 +30,7 @@ Return _the total surface area of the resulting shapes_. ![](https://assets.leetcode.com/uploads/2021/01/08/tmp-grid5.jpg) -**Input:** grid = [[2,2,2],[2,1,2],[2,2,2]] +**Input:** grid = \[\[2,2,2],[2,1,2],[2,2,2]] **Output:** 46 diff --git a/src/main/java/g0901_1000/s0909_snakes_and_ladders/readme.md b/src/main/java/g0901_1000/s0909_snakes_and_ladders/readme.md index d8a00294..b1d1f677 100644 --- a/src/main/java/g0901_1000/s0909_snakes_and_ladders/readme.md +++ b/src/main/java/g0901_1000/s0909_snakes_and_ladders/readme.md @@ -23,7 +23,7 @@ Return _the least number of moves required to reach the square_ n2stones[i] = [xi, y< **Example 1:** -**Input:** stones = [[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]] +**Input:** stones = \[\[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]] **Output:** 5 @@ -26,7 +26,7 @@ Stone [0,0] cannot be removed since it does not share a row/column with another **Example 2:** -**Input:** stones = [[0,0],[0,2],[1,1],[2,0],[2,2]] +**Input:** stones = \[\[0,0],[0,2],[1,1],[2,0],[2,2]] **Output:** 3 @@ -42,7 +42,7 @@ Stones [0,0] and [1,1] cannot be removed since they do not share a row/column wi **Example 3:** -**Input:** stones = [[0,0]] +**Input:** stones = \[\[0,0]] **Output:** 0 diff --git a/src/main/java/g0901_1000/s0963_minimum_area_rectangle_ii/readme.md b/src/main/java/g0901_1000/s0963_minimum_area_rectangle_ii/readme.md index 960553ba..9fad3306 100644 --- a/src/main/java/g0901_1000/s0963_minimum_area_rectangle_ii/readme.md +++ b/src/main/java/g0901_1000/s0963_minimum_area_rectangle_ii/readme.md @@ -12,7 +12,7 @@ Answers within 10-5 of the actual answer will be accepte ![](https://assets.leetcode.com/uploads/2018/12/21/1a.png) -**Input:** points = [[1,2],[2,1],[1,0],[0,1]] +**Input:** points = \[\[1,2],[2,1],[1,0],[0,1]] **Output:** 2.00000 @@ -22,7 +22,7 @@ Answers within 10-5 of the actual answer will be accepte ![](https://assets.leetcode.com/uploads/2018/12/22/2.png) -**Input:** points = [[0,1],[2,1],[1,1],[1,0],[2,0]] +**Input:** points = \[\[0,1],[2,1],[1,1],[1,0],[2,0]] **Output:** 1.00000 @@ -32,7 +32,7 @@ Answers within 10-5 of the actual answer will be accepte ![](https://assets.leetcode.com/uploads/2018/12/22/3.png) -**Input:** points = [[0,3],[1,2],[3,1],[1,3],[2,1]] +**Input:** points = \[\[0,3],[1,2],[3,1],[1,3],[2,1]] **Output:** 0 diff --git a/src/main/java/g0901_1000/s0973_k_closest_points_to_origin/readme.md b/src/main/java/g0901_1000/s0973_k_closest_points_to_origin/readme.md index c097d8be..63cd87b9 100644 --- a/src/main/java/g0901_1000/s0973_k_closest_points_to_origin/readme.md +++ b/src/main/java/g0901_1000/s0973_k_closest_points_to_origin/readme.md @@ -12,7 +12,7 @@ You may return the answer in **any order**. The answer is **guaranteed** to be * ![](https://assets.leetcode.com/uploads/2021/03/03/closestplane1.jpg) -**Input:** points = [[1,3],[-2,2]], k = 1 +**Input:** points = \[\[1,3],[-2,2]], k = 1 **Output:** [[-2,2]] @@ -28,7 +28,7 @@ We only want the closest k = 1 points from the origin, so the answer is just [[- **Example 2:** -**Input:** points = [[3,3],[5,-1],[-2,4]], k = 2 +**Input:** points = \[\[3,3],[5,-1],[-2,4]], k = 2 **Output:** [[3,3],[-2,4]] diff --git a/src/main/java/g0901_1000/s0980_unique_paths_iii/readme.md b/src/main/java/g0901_1000/s0980_unique_paths_iii/readme.md index 915f08db..513789b8 100644 --- a/src/main/java/g0901_1000/s0980_unique_paths_iii/readme.md +++ b/src/main/java/g0901_1000/s0980_unique_paths_iii/readme.md @@ -15,7 +15,7 @@ Return _the number of 4-directional walks from the starting square to the ending ![](https://assets.leetcode.com/uploads/2021/08/02/lc-unique1.jpg) -**Input:** grid = [[1,0,0,0],[0,0,0,0],[0,0,2,-1]] +**Input:** grid = \[\[1,0,0,0],[0,0,0,0],[0,0,2,-1]] **Output:** 2 @@ -29,7 +29,7 @@ Return _the number of 4-directional walks from the starting square to the ending ![](https://assets.leetcode.com/uploads/2021/08/02/lc-unique2.jpg) -**Input:** grid = [[1,0,0,0],[0,0,0,0],[0,0,0,2]] +**Input:** grid = \[\[1,0,0,0],[0,0,0,0],[0,0,0,2]] **Output:** 4 @@ -47,7 +47,7 @@ Return _the number of 4-directional walks from the starting square to the ending ![](https://assets.leetcode.com/uploads/2021/08/02/lc-unique3-.jpg) -**Input:** grid = [[0,1],[2,0]] +**Input:** grid = \[\[0,1],[2,0]] **Output:** 0 diff --git a/src/main/java/g0901_1000/s0985_sum_of_even_numbers_after_queries/readme.md b/src/main/java/g0901_1000/s0985_sum_of_even_numbers_after_queries/readme.md index 3372dbda..dd8dd278 100644 --- a/src/main/java/g0901_1000/s0985_sum_of_even_numbers_after_queries/readme.md +++ b/src/main/java/g0901_1000/s0985_sum_of_even_numbers_after_queries/readme.md @@ -10,7 +10,7 @@ Return _an integer array_ `answer` _where_ `answer[i]` _is the answer to the_ ith 2 **![](https://assets.leetcode.com/uploads/2020/01/02/leetcode_friends_2.png)** -**Input:** watchedVideos = [["A","B"],["C"],["B","C"],["D"]], friends = [[1,2],[0,3],[0,3],[1,2]], id = 0, level = 2 +**Input:** watchedVideos = \[\["A","B"],["C"],["B","C"],["D"]], friends = \[\[1,2],[0,3],[0,3],[1,2]], id = 0, level = 2 **Output:** ["D"] diff --git a/src/main/java/g1301_1400/s1314_matrix_block_sum/readme.md b/src/main/java/g1301_1400/s1314_matrix_block_sum/readme.md index 4a66ed06..b38da96c 100644 --- a/src/main/java/g1301_1400/s1314_matrix_block_sum/readme.md +++ b/src/main/java/g1301_1400/s1314_matrix_block_sum/readme.md @@ -10,13 +10,13 @@ Given a `m x n` matrix `mat` and an integer `k`, return _a matrix_ `answer` _whe **Example 1:** -**Input:** mat = [[1,2,3],[4,5,6],[7,8,9]], k = 1 +**Input:** mat = \[\[1,2,3],[4,5,6],[7,8,9]], k = 1 **Output:** [[12,21,16],[27,45,33],[24,39,28]] **Example 2:** -**Input:** mat = [[1,2,3],[4,5,6],[7,8,9]], k = 2 +**Input:** mat = \[\[1,2,3],[4,5,6],[7,8,9]], k = 2 **Output:** [[45,45,45],[45,45,45],[45,45,45]] diff --git a/src/main/java/g1301_1400/s1319_number_of_operations_to_make_network_connected/readme.md b/src/main/java/g1301_1400/s1319_number_of_operations_to_make_network_connected/readme.md index d41aea03..f0b153da 100644 --- a/src/main/java/g1301_1400/s1319_number_of_operations_to_make_network_connected/readme.md +++ b/src/main/java/g1301_1400/s1319_number_of_operations_to_make_network_connected/readme.md @@ -12,7 +12,7 @@ Return _the minimum number of times you need to do this in order to make all the ![](https://assets.leetcode.com/uploads/2020/01/02/sample_1_1677.png) -**Input:** n = 4, connections = [[0,1],[0,2],[1,2]] +**Input:** n = 4, connections = \[\[0,1],[0,2],[1,2]] **Output:** 1 @@ -22,13 +22,13 @@ Return _the minimum number of times you need to do this in order to make all the ![](https://assets.leetcode.com/uploads/2020/01/02/sample_2_1677.png) -**Input:** n = 6, connections = [[0,1],[0,2],[0,3],[1,2],[1,3]] +**Input:** n = 6, connections = \[\[0,1],[0,2],[0,3],[1,2],[1,3]] **Output:** 2 **Example 3:** -**Input:** n = 6, connections = [[0,1],[0,2],[0,3],[1,2]] +**Input:** n = 6, connections = \[\[0,1],[0,2],[0,3],[1,2]] **Output:** -1 diff --git a/src/main/java/g1301_1400/s1329_sort_the_matrix_diagonally/readme.md b/src/main/java/g1301_1400/s1329_sort_the_matrix_diagonally/readme.md index 749291b9..621dcf0a 100644 --- a/src/main/java/g1301_1400/s1329_sort_the_matrix_diagonally/readme.md +++ b/src/main/java/g1301_1400/s1329_sort_the_matrix_diagonally/readme.md @@ -10,13 +10,13 @@ Given an `m x n` matrix `mat` of integers, sort each **matrix diagonal** in asce ![](https://assets.leetcode.com/uploads/2020/01/21/1482_example_1_2.png) -**Input:** mat = [[3,3,1,1],[2,2,1,2],[1,1,1,2]] +**Input:** mat = \[\[3,3,1,1],[2,2,1,2],[1,1,1,2]] **Output:** [[1,1,1,1],[1,2,2,2],[1,2,3,3]] **Example 2:** -**Input:** mat = [[11,25,66,1,69,7],[23,55,17,45,15,52],[75,31,36,44,58,8],[22,27,33,25,68,4],[84,28,14,11,5,50]] +**Input:** mat = \[\[11,25,66,1,69,7],[23,55,17,45,15,52],[75,31,36,44,58,8],[22,27,33,25,68,4],[84,28,14,11,5,50]] **Output:** [[5,17,4,1,52,7],[11,11,25,45,8,69],[14,23,25,44,58,15],[22,27,31,36,50,66],[84,28,75,33,55,68]] diff --git a/src/main/java/g1301_1400/s1333_filter_restaurants_by_vegan_friendly_price_and_distance/readme.md b/src/main/java/g1301_1400/s1333_filter_restaurants_by_vegan_friendly_price_and_distance/readme.md index cda400d2..14485132 100644 --- a/src/main/java/g1301_1400/s1333_filter_restaurants_by_vegan_friendly_price_and_distance/readme.md +++ b/src/main/java/g1301_1400/s1333_filter_restaurants_by_vegan_friendly_price_and_distance/readme.md @@ -10,7 +10,7 @@ Return the array of restaurant _**IDs**_ after filtering, ordered by **rating** **Example 1:** -**Input:** restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 1, maxPrice = 50, maxDistance = 10 +**Input:** restaurants = \[\[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 1, maxPrice = 50, maxDistance = 10 **Output:** [3,1,5] @@ -30,7 +30,7 @@ After filter restaurants with veganFriendly = 1, maxPrice = 50 and maxDistance = **Example 2:** -**Input:** restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 50, maxDistance = 10 +**Input:** restaurants = \[\[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 50, maxDistance = 10 **Output:** [4,3,2,1,5] @@ -38,7 +38,7 @@ After filter restaurants with veganFriendly = 1, maxPrice = 50 and maxDistance = **Example 3:** -**Input:** restaurants = [[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 30, maxDistance = 3 +**Input:** restaurants = \[\[1,4,1,40,10],[2,8,0,50,5],[3,8,1,30,4],[4,10,0,10,3],[5,1,1,15,1]], veganFriendly = 0, maxPrice = 30, maxDistance = 3 **Output:** [4,5] diff --git a/src/main/java/g1301_1400/s1334_find_the_city_with_the_smallest_number_of_neighbors_at_a_threshold_distance/readme.md b/src/main/java/g1301_1400/s1334_find_the_city_with_the_smallest_number_of_neighbors_at_a_threshold_distance/readme.md index 4b3237ad..5e18b004 100644 --- a/src/main/java/g1301_1400/s1334_find_the_city_with_the_smallest_number_of_neighbors_at_a_threshold_distance/readme.md +++ b/src/main/java/g1301_1400/s1334_find_the_city_with_the_smallest_number_of_neighbors_at_a_threshold_distance/readme.md @@ -12,7 +12,7 @@ Notice that the distance of a path connecting cities _**i**_ and _**j**_ is equa ![](https://assets.leetcode.com/uploads/2020/01/16/find_the_city_01.png) -**Input:** n = 4, edges = [[0,1,3],[1,2,1],[1,3,4],[2,3,1]], distanceThreshold = 4 +**Input:** n = 4, edges = \[\[0,1,3],[1,2,1],[1,3,4],[2,3,1]], distanceThreshold = 4 **Output:** 3 @@ -34,7 +34,7 @@ Cities 0 and 3 have 2 neighboring cities at a distanceThreshold = 4, but we have ![](https://assets.leetcode.com/uploads/2020/01/16/find_the_city_02.png) -**Input:** n = 5, edges = [[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]], distanceThreshold = 2 +**Input:** n = 5, edges = \[\[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]], distanceThreshold = 2 **Output:** 0 diff --git a/src/main/java/g1301_1400/s1337_the_k_weakest_rows_in_a_matrix/readme.md b/src/main/java/g1301_1400/s1337_the_k_weakest_rows_in_a_matrix/readme.md index c352bde2..b56e89bf 100644 --- a/src/main/java/g1301_1400/s1337_the_k_weakest_rows_in_a_matrix/readme.md +++ b/src/main/java/g1301_1400/s1337_the_k_weakest_rows_in_a_matrix/readme.md @@ -38,7 +38,7 @@ The rows ordered from weakest to strongest are [2,0,3,1,4]. **Example 2:** -**Input:** mat = [[1,0,0,0], [1,1,1,1], [1,0,0,0], [1,0,0,0]], k = 2 +**Input:** mat = \[\[1,0,0,0], [1,1,1,1], [1,0,0,0], [1,0,0,0]], k = 2 **Output:** [0,2] diff --git a/src/main/java/g1301_1400/s1349_maximum_students_taking_exam/readme.md b/src/main/java/g1301_1400/s1349_maximum_students_taking_exam/readme.md index ca53d81c..297c4c33 100644 --- a/src/main/java/g1301_1400/s1349_maximum_students_taking_exam/readme.md +++ b/src/main/java/g1301_1400/s1349_maximum_students_taking_exam/readme.md @@ -12,7 +12,7 @@ Students must be placed in seats in good condition. ![](https://assets.leetcode.com/uploads/2020/01/29/image.png) -**Input:** seats = [["#",".","#","#",".","#"], +**Input:** seats = \[\["#",".","#","#",".","#"], [".","#","#","#","#","."], ["#",".","#","#",".","#"]] @@ -22,7 +22,7 @@ Students must be placed in seats in good condition. **Example 2:** -**Input:** seats = [[".","#"], +**Input:** seats = \[\[".","#"], ["#","#"], ["#","."], ["#","#"], @@ -34,7 +34,7 @@ Students must be placed in seats in good condition. **Example 3:** -**Input:** seats = [["#",".","**.**",".","#"], +**Input:** seats = \[\["#",".","**.**",".","#"], ["**.**","#","**.**","#","**.**"], ["**.**",".","#",".","**.**"], ["**.**","#","**.**","#","**.**"], diff --git a/src/main/java/g1301_1400/s1351_count_negative_numbers_in_a_sorted_matrix/readme.md b/src/main/java/g1301_1400/s1351_count_negative_numbers_in_a_sorted_matrix/readme.md index 264e6456..30994b6c 100644 --- a/src/main/java/g1301_1400/s1351_count_negative_numbers_in_a_sorted_matrix/readme.md +++ b/src/main/java/g1301_1400/s1351_count_negative_numbers_in_a_sorted_matrix/readme.md @@ -6,7 +6,7 @@ Given a `m x n` matrix `grid` which is sorted in non-increasing order both row-w **Example 1:** -**Input:** grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]] +**Input:** grid = \[\[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]] **Output:** 8 @@ -14,7 +14,7 @@ Given a `m x n` matrix `grid` which is sorted in non-increasing order both row-w **Example 2:** -**Input:** grid = [[3,2],[1,0]] +**Input:** grid = \[\[3,2],[1,0]] **Output:** 0 diff --git a/src/main/java/g1301_1400/s1353_maximum_number_of_events_that_can_be_attended/readme.md b/src/main/java/g1301_1400/s1353_maximum_number_of_events_that_can_be_attended/readme.md index a034261d..eec58f72 100644 --- a/src/main/java/g1301_1400/s1353_maximum_number_of_events_that_can_be_attended/readme.md +++ b/src/main/java/g1301_1400/s1353_maximum_number_of_events_that_can_be_attended/readme.md @@ -12,7 +12,7 @@ Return _the maximum number of events you can attend_. ![](https://assets.leetcode.com/uploads/2020/02/05/e1.png) -**Input:** events = [[1,2],[2,3],[3,4]] +**Input:** events = \[\[1,2],[2,3],[3,4]] **Output:** 3 diff --git a/src/main/java/g1301_1400/s1368_minimum_cost_to_make_at_least_one_valid_path_in_a_grid/readme.md b/src/main/java/g1301_1400/s1368_minimum_cost_to_make_at_least_one_valid_path_in_a_grid/readme.md index 553a08fb..27d59633 100644 --- a/src/main/java/g1301_1400/s1368_minimum_cost_to_make_at_least_one_valid_path_in_a_grid/readme.md +++ b/src/main/java/g1301_1400/s1368_minimum_cost_to_make_at_least_one_valid_path_in_a_grid/readme.md @@ -21,7 +21,7 @@ Return _the minimum cost to make the grid have at least one valid path_. ![](https://assets.leetcode.com/uploads/2020/02/13/grid1.png) -**Input:** grid = [[1,1,1,1],[2,2,2,2],[1,1,1,1],[2,2,2,2]] +**Input:** grid = \[\[1,1,1,1],[2,2,2,2],[1,1,1,1],[2,2,2,2]] **Output:** 3 @@ -31,7 +31,7 @@ Return _the minimum cost to make the grid have at least one valid path_. ![](https://assets.leetcode.com/uploads/2020/02/13/grid2.png) -**Input:** grid = [[1,1,3],[3,2,2],[1,1,4]] +**Input:** grid = \[\[1,1,3],[3,2,2],[1,1,4]] **Output:** 0 @@ -41,7 +41,7 @@ Return _the minimum cost to make the grid have at least one valid path_. ![](https://assets.leetcode.com/uploads/2020/02/13/grid3.png) -**Input:** grid = [[1,2],[4,3]] +**Input:** grid = \[\[1,2],[4,3]] **Output:** 1 diff --git a/src/main/java/g1301_1400/s1377_frog_position_after_t_seconds/readme.md b/src/main/java/g1301_1400/s1377_frog_position_after_t_seconds/readme.md index c49431cc..435b5cfd 100644 --- a/src/main/java/g1301_1400/s1377_frog_position_after_t_seconds/readme.md +++ b/src/main/java/g1301_1400/s1377_frog_position_after_t_seconds/readme.md @@ -12,7 +12,7 @@ _Return the probability that after `t` seconds the frog is on the vertex `target ![](https://assets.leetcode.com/uploads/2021/12/21/frog1.jpg) -**Input:** n = 7, edges = [[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 2, target = 4 +**Input:** n = 7, edges = \[\[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 2, target = 4 **Output:** 0.16666666666666666 @@ -22,7 +22,7 @@ _Return the probability that after `t` seconds the frog is on the vertex `target **![](https://assets.leetcode.com/uploads/2021/12/21/frog2.jpg)** -**Input:** n = 7, edges = [[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 1, target = 7 +**Input:** n = 7, edges = \[\[1,2],[1,3],[1,7],[2,4],[2,6],[3,5]], t = 1, target = 7 **Output:** 0.3333333333333333 diff --git a/src/main/java/g1301_1400/s1380_lucky_numbers_in_a_matrix/readme.md b/src/main/java/g1301_1400/s1380_lucky_numbers_in_a_matrix/readme.md index 15569865..4551ddc7 100644 --- a/src/main/java/g1301_1400/s1380_lucky_numbers_in_a_matrix/readme.md +++ b/src/main/java/g1301_1400/s1380_lucky_numbers_in_a_matrix/readme.md @@ -8,7 +8,7 @@ A **lucky number** is an element of the matrix such that it is the minimum eleme **Example 1:** -**Input:** matrix = [[3,7,8],[9,11,13],[15,16,17]] +**Input:** matrix = \[\[3,7,8],[9,11,13],[15,16,17]] **Output:** [15] @@ -16,7 +16,7 @@ A **lucky number** is an element of the matrix such that it is the minimum eleme **Example 2:** -**Input:** matrix = [[1,10,4,2],[9,3,8,7],[15,16,17,12]] +**Input:** matrix = \[\[1,10,4,2],[9,3,8,7],[15,16,17,12]] **Output:** [12] @@ -24,7 +24,7 @@ A **lucky number** is an element of the matrix such that it is the minimum eleme **Example 3:** -**Input:** matrix = [[7,8],[1,2]] +**Input:** matrix = \[\[7,8],[1,2]] **Output:** [7] diff --git a/src/main/java/g1301_1400/s1386_cinema_seat_allocation/readme.md b/src/main/java/g1301_1400/s1386_cinema_seat_allocation/readme.md index 7b64b539..1c091acd 100644 --- a/src/main/java/g1301_1400/s1386_cinema_seat_allocation/readme.md +++ b/src/main/java/g1301_1400/s1386_cinema_seat_allocation/readme.md @@ -14,7 +14,7 @@ _Return the maximum number of four-person groups you can assign on the cinema se ![](https://assets.leetcode.com/uploads/2020/02/14/cinema_seats_3.png) -**Input:** n = 3, reservedSeats = [[1,2],[1,3],[1,8],[2,6],[3,1],[3,10]] +**Input:** n = 3, reservedSeats = \[\[1,2],[1,3],[1,8],[2,6],[3,1],[3,10]] **Output:** 4 @@ -22,13 +22,13 @@ _Return the maximum number of four-person groups you can assign on the cinema se **Example 2:** -**Input:** n = 2, reservedSeats = [[2,1],[1,8],[2,6]] +**Input:** n = 2, reservedSeats = \[\[2,1],[1,8],[2,6]] **Output:** 2 **Example 3:** -**Input:** n = 4, reservedSeats = [[4,3],[1,4],[4,6],[1,7]] +**Input:** n = 4, reservedSeats = \[\[4,3],[1,4],[4,6],[1,7]] **Output:** 4 diff --git a/src/main/java/g1301_1400/s1391_check_if_there_is_a_valid_path_in_a_grid/readme.md b/src/main/java/g1301_1400/s1391_check_if_there_is_a_valid_path_in_a_grid/readme.md index d6f312dc..9b1a5f85 100644 --- a/src/main/java/g1301_1400/s1391_check_if_there_is_a_valid_path_in_a_grid/readme.md +++ b/src/main/java/g1301_1400/s1391_check_if_there_is_a_valid_path_in_a_grid/readme.md @@ -23,7 +23,7 @@ Return `true` _if there is a valid path in the grid or_ `false` _otherwise_. ![](https://assets.leetcode.com/uploads/2020/03/05/e1.png) -**Input:** grid = [[2,4,3],[6,5,2]] +**Input:** grid = \[\[2,4,3],[6,5,2]] **Output:** true @@ -33,7 +33,7 @@ Return `true` _if there is a valid path in the grid or_ `false` _otherwise_. ![](https://assets.leetcode.com/uploads/2020/03/05/e2.png) -**Input:** grid = [[1,2,1],[1,2,1]] +**Input:** grid = \[\[1,2,1],[1,2,1]] **Output:** false @@ -41,7 +41,7 @@ Return `true` _if there is a valid path in the grid or_ `false` _otherwise_. **Example 3:** -**Input:** grid = [[1,1,2]] +**Input:** grid = \[\[1,1,2]] **Output:** false diff --git a/src/main/java/g1401_1500/s1418_display_table_of_food_orders_in_a_restaurant/readme.md b/src/main/java/g1401_1500/s1418_display_table_of_food_orders_in_a_restaurant/readme.md index d00182fa..af3e9104 100644 --- a/src/main/java/g1401_1500/s1418_display_table_of_food_orders_in_a_restaurant/readme.md +++ b/src/main/java/g1401_1500/s1418_display_table_of_food_orders_in_a_restaurant/readme.md @@ -8,7 +8,7 @@ _Return the restaurant's “**display table**”_. The “**display table**” i **Example 1:** -**Input:** orders = [["David","3","Ceviche"],["Corina","10","Beef Burrito"],["David","3","Fried Chicken"],["Carla","5","Water"],["Carla","5","Ceviche"],["Rous","3","Ceviche"]] +**Input:** orders = \[\["David","3","Ceviche"],["Corina","10","Beef Burrito"],["David","3","Fried Chicken"],["Carla","5","Water"],["Carla","5","Ceviche"],["Rous","3","Ceviche"]] **Output:** [["Table","Beef Burrito","Ceviche","Fried Chicken","Water"],["3","0","2","1","0"],["5","0","1","0","1"],["10","1","0","0","0"]] @@ -30,7 +30,7 @@ For the table 10: Corina orders "Beef Burrito". **Example 2:** -**Input:** orders = [["James","12","Fried Chicken"],["Ratesh","12","Fried Chicken"],["Amadeus","12","Fried Chicken"],["Adam","1","Canadian Waffles"],["Brianna","1","Canadian Waffles"]] +**Input:** orders = \[\["James","12","Fried Chicken"],["Ratesh","12","Fried Chicken"],["Amadeus","12","Fried Chicken"],["Adam","1","Canadian Waffles"],["Brianna","1","Canadian Waffles"]] **Output:** [["Table","Canadian Waffles","Fried Chicken"],["1","2","0"],["12","0","3"]] @@ -42,7 +42,7 @@ For the table 12: James, Ratesh and Amadeus order "Fried Chicken". **Example 3:** -**Input:** orders = [["Laura","2","Bean Burrito"],["Jhon","2","Beef Burrito"],["Melissa","2","Soda"]] +**Input:** orders = \[\["Laura","2","Bean Burrito"],["Jhon","2","Beef Burrito"],["Melissa","2","Soda"]] **Output:** [["Table","Bean Burrito","Beef Burrito","Soda"],["2","1","1","1"]] diff --git a/src/main/java/g1401_1500/s1424_diagonal_traverse_ii/readme.md b/src/main/java/g1401_1500/s1424_diagonal_traverse_ii/readme.md index 4bb2dc43..6bce556e 100644 --- a/src/main/java/g1401_1500/s1424_diagonal_traverse_ii/readme.md +++ b/src/main/java/g1401_1500/s1424_diagonal_traverse_ii/readme.md @@ -8,7 +8,7 @@ Given a 2D integer array `nums`, return _all elements of_ `nums` _in diagonal or ![](https://assets.leetcode.com/uploads/2020/04/08/sample_1_1784.png) -**Input:** nums = [[1,2,3],[4,5,6],[7,8,9]] +**Input:** nums = \[\[1,2,3],[4,5,6],[7,8,9]] **Output:** [1,4,2,7,5,3,8,6,9] @@ -16,7 +16,7 @@ Given a 2D integer array `nums`, return _all elements of_ `nums` _in diagonal or ![](https://assets.leetcode.com/uploads/2020/04/08/sample_2_1784.png) -**Input:** nums = [[1,2,3,4,5],[6,7],[8],[9,10,11],[12,13,14,15,16]] +**Input:** nums = \[\[1,2,3,4,5],[6,7],[8],[9,10,11],[12,13,14,15,16]] **Output:** [1,6,2,8,7,3,9,4,12,10,5,13,11,14,15,16] diff --git a/src/main/java/g1401_1500/s1434_number_of_ways_to_wear_different_hats_to_each_other/readme.md b/src/main/java/g1401_1500/s1434_number_of_ways_to_wear_different_hats_to_each_other/readme.md index 5c001163..904d0d53 100644 --- a/src/main/java/g1401_1500/s1434_number_of_ways_to_wear_different_hats_to_each_other/readme.md +++ b/src/main/java/g1401_1500/s1434_number_of_ways_to_wear_different_hats_to_each_other/readme.md @@ -12,7 +12,7 @@ Since the answer may be too large, return it modulo 109 + 7109 + 7109 + 7kth _smallest array sum among all possible **Example 1:** -**Input:** mat = [[1,3,11],[2,4,6]], k = 5 +**Input:** mat = \[\[1,3,11],[2,4,6]], k = 5 **Output:** 7 @@ -18,13 +18,13 @@ Return _the_ kth _smallest array sum among all possible **Example 2:** -**Input:** mat = [[1,3,11],[2,4,6]], k = 9 +**Input:** mat = \[\[1,3,11],[2,4,6]], k = 9 **Output:** 17 **Example 3:** -**Input:** mat = [[1,10,10],[1,4,5],[2,3,6]], k = 7 +**Input:** mat = \[\[1,10,10],[1,4,5],[2,3,6]], k = 7 **Output:** 9 diff --git a/src/main/java/g1401_1500/s1443_minimum_time_to_collect_all_apples_in_a_tree/readme.md b/src/main/java/g1401_1500/s1443_minimum_time_to_collect_all_apples_in_a_tree/readme.md index cca2463b..e71c7b96 100644 --- a/src/main/java/g1401_1500/s1443_minimum_time_to_collect_all_apples_in_a_tree/readme.md +++ b/src/main/java/g1401_1500/s1443_minimum_time_to_collect_all_apples_in_a_tree/readme.md @@ -10,7 +10,7 @@ The edges of the undirected tree are given in the array `edges`, where edg ![](https://assets.leetcode.com/uploads/2020/04/23/min_time_collect_apple_1.png) -**Input:** n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,true,true,false] +**Input:** n = 7, edges = \[\[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,true,true,false] **Output:** 8 @@ -20,7 +20,7 @@ The edges of the undirected tree are given in the array `edges`, where edg ![](https://assets.leetcode.com/uploads/2020/04/23/min_time_collect_apple_2.png) -**Input:** n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,false,true,false] +**Input:** n = 7, edges = \[\[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,true,false,false,true,false] **Output:** 6 @@ -28,7 +28,7 @@ The edges of the undirected tree are given in the array `edges`, where edg **Example 3:** -**Input:** n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,false,false,false,false,false] +**Input:** n = 7, edges = \[\[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], hasApple = [false,false,false,false,false,false,false] **Output:** 0 diff --git a/src/main/java/g1401_1500/s1452_people_whose_list_of_favorite_companies_is_not_a_subset_of_another_list/readme.md b/src/main/java/g1401_1500/s1452_people_whose_list_of_favorite_companies_is_not_a_subset_of_another_list/readme.md index 2f7ac12b..b8afaa32 100644 --- a/src/main/java/g1401_1500/s1452_people_whose_list_of_favorite_companies_is_not_a_subset_of_another_list/readme.md +++ b/src/main/java/g1401_1500/s1452_people_whose_list_of_favorite_companies_is_not_a_subset_of_another_list/readme.md @@ -8,7 +8,7 @@ _Return the indices of people whose list of favorite companies is not a **subset **Example 1:** -**Input:** favoriteCompanies = [["leetcode","google","facebook"],["google","microsoft"],["google","facebook"],["google"],["amazon"]] +**Input:** favoriteCompanies = \[\["leetcode","google","facebook"],["google","microsoft"],["google","facebook"],["google"],["amazon"]] **Output:** [0,1,4] @@ -16,7 +16,7 @@ _Return the indices of people whose list of favorite companies is not a **subset **Example 2:** -**Input:** favoriteCompanies = [["leetcode","google","facebook"],["leetcode","amazon"],["facebook","google"]] +**Input:** favoriteCompanies = \[\["leetcode","google","facebook"],["leetcode","amazon"],["facebook","google"]] **Output:** [0,1] @@ -24,7 +24,7 @@ _Return the indices of people whose list of favorite companies is not a **subset **Example 3:** -**Input:** favoriteCompanies = [["leetcode"],["google"],["facebook"],["amazon"]] +**Input:** favoriteCompanies = \[\["leetcode"],["google"],["facebook"],["amazon"]] **Output:** [0,1,2,3] diff --git a/src/main/java/g1401_1500/s1453_maximum_number_of_darts_inside_of_a_circular_dartboard/readme.md b/src/main/java/g1401_1500/s1453_maximum_number_of_darts_inside_of_a_circular_dartboard/readme.md index 56c392c4..42af9ec9 100644 --- a/src/main/java/g1401_1500/s1453_maximum_number_of_darts_inside_of_a_circular_dartboard/readme.md +++ b/src/main/java/g1401_1500/s1453_maximum_number_of_darts_inside_of_a_circular_dartboard/readme.md @@ -12,7 +12,7 @@ Given the integer `r`, return _the maximum number of darts that can lie on the d ![](https://assets.leetcode.com/uploads/2020/04/29/sample_1_1806.png) -**Input:** darts = [[-2,0],[2,0],[0,2],[0,-2]], r = 2 +**Input:** darts = \[\[-2,0],[2,0],[0,2],[0,-2]], r = 2 **Output:** 4 @@ -22,7 +22,7 @@ Given the integer `r`, return _the maximum number of darts that can lie on the d ![](https://assets.leetcode.com/uploads/2020/04/29/sample_2_1806.png) -**Input:** darts = [[-3,0],[3,0],[2,6],[5,4],[0,9],[7,8]], r = 5 +**Input:** darts = \[\[-3,0],[3,0],[2,6],[5,4],[0,9],[7,8]], r = 5 **Output:** 5 diff --git a/src/main/java/g1401_1500/s1462_course_schedule_iv/readme.md b/src/main/java/g1401_1500/s1462_course_schedule_iv/readme.md index 9a83a1e1..a5e6fc8b 100644 --- a/src/main/java/g1401_1500/s1462_course_schedule_iv/readme.md +++ b/src/main/java/g1401_1500/s1462_course_schedule_iv/readme.md @@ -16,7 +16,7 @@ Return _a boolean array_ `answer`_, where_ `answer[j]` _is the answer to the_ 10-5 of the actual value will be accepted ![](https://assets.leetcode.com/uploads/2020/06/25/q4_e1.jpg) -**Input:** positions = [[0,1],[1,0],[1,2],[2,1]] +**Input:** positions = \[\[0,1],[1,0],[1,2],[2,1]] **Output:** 4.00000 @@ -26,7 +26,7 @@ Answers within 10-5 of the actual value will be accepted ![](https://assets.leetcode.com/uploads/2020/06/25/q4_e3.jpg) -**Input:** positions = [[1,1],[3,3]] +**Input:** positions = \[\[1,1],[3,3]] **Output:** 2.82843 diff --git a/src/main/java/g1501_1600/s1519_number_of_nodes_in_the_sub_tree_with_the_same_label/readme.md b/src/main/java/g1501_1600/s1519_number_of_nodes_in_the_sub_tree_with_the_same_label/readme.md index 929a33b9..4f940e5f 100644 --- a/src/main/java/g1501_1600/s1519_number_of_nodes_in_the_sub_tree_with_the_same_label/readme.md +++ b/src/main/java/g1501_1600/s1519_number_of_nodes_in_the_sub_tree_with_the_same_label/readme.md @@ -14,7 +14,7 @@ A subtree of a tree `T` is the tree consisting of a node in `T` and all of its d ![](https://assets.leetcode.com/uploads/2020/07/01/q3e1.jpg) -**Input:** n = 7, edges = [[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], labels = "abaedcd" +**Input:** n = 7, edges = \[\[0,1],[0,2],[1,4],[1,5],[2,3],[2,6]], labels = "abaedcd" **Output:** [2,1,1,1,1,1,1] @@ -26,7 +26,7 @@ Node 1 has a label 'b'. The sub-tree of node 1 contains nodes 1,4 and 5, as node ![](https://assets.leetcode.com/uploads/2020/07/01/q3e2.jpg) -**Input:** n = 4, edges = [[0,1],[1,2],[0,3]], labels = "bbbb" +**Input:** n = 4, edges = \[\[0,1],[1,2],[0,3]], labels = "bbbb" **Output:** [4,2,1,1] @@ -42,7 +42,7 @@ The sub-tree of node 0 contains nodes 0, 1, 2 and 3, all with label 'b', thus th ![](https://assets.leetcode.com/uploads/2020/07/01/q3e3.jpg) -**Input:** n = 5, edges = [[0,1],[0,2],[1,3],[0,4]], labels = "aabab" +**Input:** n = 5, edges = \[\[0,1],[0,2],[1,3],[0,4]], labels = "aabab" **Output:** [3,2,1,1,1] diff --git a/src/main/java/g1501_1600/s1521_find_a_value_of_a_mysterious_function_closest_to_target/readme.md b/src/main/java/g1501_1600/s1521_find_a_value_of_a_mysterious_function_closest_to_target/readme.md index f4f8251f..5c25e1ef 100644 --- a/src/main/java/g1501_1600/s1521_find_a_value_of_a_mysterious_function_closest_to_target/readme.md +++ b/src/main/java/g1501_1600/s1521_find_a_value_of_a_mysterious_function_closest_to_target/readme.md @@ -16,7 +16,7 @@ Notice that `func` should be called with the values `l` and `r` where `0 <= l, r **Output:** 2 -**Explanation:** Calling func with all the pairs of [l,r] = [[0,0],[1,1],[2,2],[3,3],[4,4],[0,1],[1,2],[2,3],[3,4],[0,2],[1,3],[2,4],[0,3],[1,4],[0,4]], Winston got the following results [9,12,3,7,15,8,0,3,7,0,0,3,0,0,0]. The value closest to 5 is 7 and 3, thus the minimum difference is 2. +**Explanation:** Calling func with all the pairs of [l,r] = \[\[0,0],[1,1],[2,2],[3,3],[4,4],[0,1],[1,2],[2,3],[3,4],[0,2],[1,3],[2,4],[0,3],[1,4],[0,4]], Winston got the following results [9,12,3,7,15,8,0,3,7,0,0,3,0,0,0]. The value closest to 5 is 7 and 3, thus the minimum difference is 2. **Example 2:** diff --git a/src/main/java/g1501_1600/s1536_minimum_swaps_to_arrange_a_binary_grid/readme.md b/src/main/java/g1501_1600/s1536_minimum_swaps_to_arrange_a_binary_grid/readme.md index f14bdd4f..b85838cf 100644 --- a/src/main/java/g1501_1600/s1536_minimum_swaps_to_arrange_a_binary_grid/readme.md +++ b/src/main/java/g1501_1600/s1536_minimum_swaps_to_arrange_a_binary_grid/readme.md @@ -14,7 +14,7 @@ The main diagonal of a grid is the diagonal that starts at cell `(1, 1)` and end ![](https://assets.leetcode.com/uploads/2020/07/28/fw.jpg) -**Input:** grid = [[0,0,1],[1,1,0],[1,0,0]] +**Input:** grid = \[\[0,0,1],[1,1,0],[1,0,0]] **Output:** 3 @@ -22,7 +22,7 @@ The main diagonal of a grid is the diagonal that starts at cell `(1, 1)` and end ![](https://assets.leetcode.com/uploads/2020/07/16/e2.jpg) -**Input:** grid = [[0,1,1,0],[0,1,1,0],[0,1,1,0],[0,1,1,0]] +**Input:** grid = \[\[0,1,1,0],[0,1,1,0],[0,1,1,0],[0,1,1,0]] **Output:** -1 @@ -32,7 +32,7 @@ The main diagonal of a grid is the diagonal that starts at cell `(1, 1)` and end ![](https://assets.leetcode.com/uploads/2020/07/16/e3.jpg) -**Input:** grid = [[1,0,0],[1,1,0],[1,1,1]] +**Input:** grid = \[\[1,0,0],[1,1,0],[1,1,1]] **Output:** 0 diff --git a/src/main/java/g1501_1600/s1557_minimum_number_of_vertices_to_reach_all_nodes/readme.md b/src/main/java/g1501_1600/s1557_minimum_number_of_vertices_to_reach_all_nodes/readme.md index e0c66c8f..ea9e932f 100644 --- a/src/main/java/g1501_1600/s1557_minimum_number_of_vertices_to_reach_all_nodes/readme.md +++ b/src/main/java/g1501_1600/s1557_minimum_number_of_vertices_to_reach_all_nodes/readme.md @@ -12,7 +12,7 @@ Notice that you can return the vertices in any order. ![](https://assets.leetcode.com/uploads/2020/07/07/untitled22.png) -**Input:** n = 6, edges = [[0,1],[0,2],[2,5],[3,4],[4,2]] +**Input:** n = 6, edges = \[\[0,1],[0,2],[2,5],[3,4],[4,2]] **Output:** [0,3] @@ -22,7 +22,7 @@ Notice that you can return the vertices in any order. ![](https://assets.leetcode.com/uploads/2020/07/07/untitled.png) -**Input:** n = 5, edges = [[0,1],[2,1],[3,1],[1,4],[2,4]] +**Input:** n = 5, edges = \[\[0,1],[2,1],[3,1],[1,4],[2,4]] **Output:** [0,2,3] diff --git a/src/main/java/g1501_1600/s1559_detect_cycles_in_2d_grid/readme.md b/src/main/java/g1501_1600/s1559_detect_cycles_in_2d_grid/readme.md index 02b10ccc..876d35ec 100644 --- a/src/main/java/g1501_1600/s1559_detect_cycles_in_2d_grid/readme.md +++ b/src/main/java/g1501_1600/s1559_detect_cycles_in_2d_grid/readme.md @@ -14,7 +14,7 @@ Return `true` if any cycle of the same value exists in `grid`, otherwise, return **![](https://assets.leetcode.com/uploads/2020/07/15/1.png)** -**Input:** grid = [["a","a","a","a"],["a","b","b","a"],["a","b","b","a"],["a","a","a","a"]] +**Input:** grid = \[\["a","a","a","a"],["a","b","b","a"],["a","b","b","a"],["a","a","a","a"]] **Output:** true @@ -24,7 +24,7 @@ Return `true` if any cycle of the same value exists in `grid`, otherwise, return **![](https://assets.leetcode.com/uploads/2020/07/15/22.png)** -**Input:** grid = [["c","c","c","a"],["c","d","c","c"],["c","c","e","c"],["f","c","c","c"]] +**Input:** grid = \[\["c","c","c","a"],["c","d","c","c"],["c","c","e","c"],["f","c","c","c"]] **Output:** true @@ -34,7 +34,7 @@ Return `true` if any cycle of the same value exists in `grid`, otherwise, return **![](https://assets.leetcode.com/uploads/2020/07/15/3.png)** -**Input:** grid = [["a","b","b"],["b","z","b"],["b","b","a"]] +**Input:** grid = \[\["a","b","b"],["b","z","b"],["b","b","a"]] **Output:** false diff --git a/src/main/java/g1501_1600/s1568_minimum_number_of_days_to_disconnect_island/readme.md b/src/main/java/g1501_1600/s1568_minimum_number_of_days_to_disconnect_island/readme.md index 54a34030..0e1ec35e 100644 --- a/src/main/java/g1501_1600/s1568_minimum_number_of_days_to_disconnect_island/readme.md +++ b/src/main/java/g1501_1600/s1568_minimum_number_of_days_to_disconnect_island/readme.md @@ -14,7 +14,7 @@ Return _the minimum number of days to disconnect the grid_. ![](https://assets.leetcode.com/uploads/2021/12/24/land1.jpg) -**Input:** grid = [[0,1,1,0],[0,1,1,0],[0,0,0,0]] +**Input:** grid = \[\[0,1,1,0],[0,1,1,0],[0,0,0,0]] **Output:** 2 @@ -24,7 +24,7 @@ Return _the minimum number of days to disconnect the grid_. ![](https://assets.leetcode.com/uploads/2021/12/24/land2.jpg) -**Input:** grid = [[1,1]] +**Input:** grid = \[\[1,1]] **Output:** 2 diff --git a/src/main/java/g1501_1600/s1572_matrix_diagonal_sum/readme.md b/src/main/java/g1501_1600/s1572_matrix_diagonal_sum/readme.md index 8091e506..037dbd42 100644 --- a/src/main/java/g1501_1600/s1572_matrix_diagonal_sum/readme.md +++ b/src/main/java/g1501_1600/s1572_matrix_diagonal_sum/readme.md @@ -10,7 +10,7 @@ Only include the sum of all the elements on the primary diagonal and all the ele ![](https://assets.leetcode.com/uploads/2020/08/14/sample_1911.png) -**Input:** mat = [[**1**,2,**3**], +**Input:** mat = \[\[**1**,2,**3**], [4,**5**,6], [**7**,8,**9**]] @@ -20,7 +20,7 @@ Only include the sum of all the elements on the primary diagonal and all the ele **Example 2:** -**Input:** mat = [[**1**,1,1,**1**], +**Input:** mat = \[\[**1**,1,1,**1**], [1,**1**,**1**,1], [1,**1**,**1**,1], [**1**,1,1,**1**]] @@ -29,7 +29,7 @@ Only include the sum of all the elements on the primary diagonal and all the ele **Example 3:** -**Input:** mat = [[**5**]] +**Input:** mat = \[\[**5**]] **Output:** 5 diff --git a/src/main/java/g1501_1600/s1579_remove_max_number_of_edges_to_keep_graph_fully_traversable/readme.md b/src/main/java/g1501_1600/s1579_remove_max_number_of_edges_to_keep_graph_fully_traversable/readme.md index 6ab53bb4..313d51a1 100644 --- a/src/main/java/g1501_1600/s1579_remove_max_number_of_edges_to_keep_graph_fully_traversable/readme.md +++ b/src/main/java/g1501_1600/s1579_remove_max_number_of_edges_to_keep_graph_fully_traversable/readme.md @@ -16,7 +16,7 @@ Return _the maximum number of edges you can remove, or return_ `-1` _if it's imp **![](https://assets.leetcode.com/uploads/2020/08/19/ex1.png)** -**Input:** n = 4, edges = [[3,1,2],[3,2,3],[1,1,3],[1,2,4],[1,1,2],[2,3,4]] +**Input:** n = 4, edges = \[\[3,1,2],[3,2,3],[1,1,3],[1,2,4],[1,1,2],[2,3,4]] **Output:** 2 @@ -26,7 +26,7 @@ Return _the maximum number of edges you can remove, or return_ `-1` _if it's imp **![](https://assets.leetcode.com/uploads/2020/08/19/ex2.png)** -**Input:** n = 4, edges = [[3,1,2],[3,2,3],[1,1,4],[2,1,4]] +**Input:** n = 4, edges = \[\[3,1,2],[3,2,3],[1,1,4],[2,1,4]] **Output:** 0 @@ -36,7 +36,7 @@ Return _the maximum number of edges you can remove, or return_ `-1` _if it's imp **![](https://assets.leetcode.com/uploads/2020/08/19/ex3.png)** -**Input:** n = 4, edges = [[3,2,3],[1,1,2],[2,3,4]] +**Input:** n = 4, edges = \[\[3,2,3],[1,1,2],[2,3,4]] **Output:** -1 diff --git a/src/main/java/g1501_1600/s1582_special_positions_in_a_binary_matrix/readme.md b/src/main/java/g1501_1600/s1582_special_positions_in_a_binary_matrix/readme.md index 799b5f71..707fc09b 100644 --- a/src/main/java/g1501_1600/s1582_special_positions_in_a_binary_matrix/readme.md +++ b/src/main/java/g1501_1600/s1582_special_positions_in_a_binary_matrix/readme.md @@ -10,7 +10,7 @@ A position `(i, j)` is called **special** if `mat[i][j] == 1` and all other elem ![](https://assets.leetcode.com/uploads/2021/12/23/special1.jpg) -**Input:** mat = [[1,0,0],[0,0,1],[1,0,0]] +**Input:** mat = \[\[1,0,0],[0,0,1],[1,0,0]] **Output:** 1 @@ -20,7 +20,7 @@ A position `(i, j)` is called **special** if `mat[i][j] == 1` and all other elem ![](https://assets.leetcode.com/uploads/2021/12/24/special-grid.jpg) -**Input:** mat = [[1,0,0],[0,1,0],[0,0,1]] +**Input:** mat = \[\[1,0,0],[0,1,0],[0,0,1]] **Output:** 3 diff --git a/src/main/java/g1501_1600/s1583_count_unhappy_friends/readme.md b/src/main/java/g1501_1600/s1583_count_unhappy_friends/readme.md index 6c21d9be..85f5d305 100644 --- a/src/main/java/g1501_1600/s1583_count_unhappy_friends/readme.md +++ b/src/main/java/g1501_1600/s1583_count_unhappy_friends/readme.md @@ -17,7 +17,7 @@ Return _the number of unhappy friends_. **Example 1:** -**Input:** n = 4, preferences = [[1, 2, 3], [3, 2, 0], [3, 1, 0], [1, 2, 0]], pairs = [[0, 1], [2, 3]] +**Input:** n = 4, preferences = \[\[1, 2, 3], [3, 2, 0], [3, 1, 0], [1, 2, 0]], pairs = \[\[0, 1], [2, 3]] **Output:** 2 @@ -39,7 +39,7 @@ Friends 0 and 2 are happy. **Example 2:** -**Input:** n = 2, preferences = [[1], [0]], pairs = [[1, 0]] +**Input:** n = 2, preferences = \[\[1], [0]], pairs = \[\[1, 0]] **Output:** 0 @@ -47,7 +47,7 @@ Friends 0 and 2 are happy. **Example 3:** -**Input:** n = 4, preferences = [[1, 3, 2], [2, 3, 0], [1, 3, 0], [0, 2, 1]], pairs = [[1, 3], [0, 2]] +**Input:** n = 4, preferences = \[\[1, 3, 2], [2, 3, 0], [1, 3, 0], [0, 2, 1]], pairs = \[\[1, 3], [0, 2]] **Output:** 4 diff --git a/src/main/java/g1501_1600/s1584_min_cost_to_connect_all_points/readme.md b/src/main/java/g1501_1600/s1584_min_cost_to_connect_all_points/readme.md index 3dacfafa..799fd4ab 100644 --- a/src/main/java/g1501_1600/s1584_min_cost_to_connect_all_points/readme.md +++ b/src/main/java/g1501_1600/s1584_min_cost_to_connect_all_points/readme.md @@ -12,7 +12,7 @@ Return _the minimum cost to make all points connected._ All points are connected ![](https://assets.leetcode.com/uploads/2020/08/26/d.png) -**Input:** points = [[0,0],[2,2],[3,10],[5,2],[7,0]] +**Input:** points = \[\[0,0],[2,2],[3,10],[5,2],[7,0]] **Output:** 20 @@ -24,7 +24,7 @@ Notice that there is a unique path between every pair of points. **Example 2:** -**Input:** points = [[3,12],[-2,5],[-4,1]] +**Input:** points = \[\[3,12],[-2,5],[-4,1]] **Output:** 18 diff --git a/src/main/java/g1501_1600/s1589_maximum_sum_obtained_of_any_permutation/readme.md b/src/main/java/g1501_1600/s1589_maximum_sum_obtained_of_any_permutation/readme.md index 56d77751..9c265e97 100644 --- a/src/main/java/g1501_1600/s1589_maximum_sum_obtained_of_any_permutation/readme.md +++ b/src/main/java/g1501_1600/s1589_maximum_sum_obtained_of_any_permutation/readme.md @@ -10,7 +10,7 @@ Since the answer may be too large, return it **modulo** 109 + 7 **Example 1:** -**Input:** nums = [1,2,3,4,5], requests = [[1,3],[0,1]] +**Input:** nums = [1,2,3,4,5], requests = \[\[1,3],[0,1]] **Output:** 19 @@ -32,7 +32,7 @@ Total sum: 11 + 8 = 19, which is the best that you can do. **Example 2:** -**Input:** nums = [1,2,3,4,5,6], requests = [[0,1]] +**Input:** nums = [1,2,3,4,5,6], requests = \[\[0,1]] **Output:** 11 @@ -40,7 +40,7 @@ Total sum: 11 + 8 = 19, which is the best that you can do. **Example 3:** -**Input:** nums = [1,2,3,4,5,10], requests = [[0,2],[1,3],[1,1]] +**Input:** nums = [1,2,3,4,5,10], requests = \[\[0,2],[1,3],[1,1]] **Output:** 47 diff --git a/src/main/java/g1501_1600/s1591_strange_printer_ii/readme.md b/src/main/java/g1501_1600/s1591_strange_printer_ii/readme.md index 5f5b913e..09c43dca 100644 --- a/src/main/java/g1501_1600/s1591_strange_printer_ii/readme.md +++ b/src/main/java/g1501_1600/s1591_strange_printer_ii/readme.md @@ -15,7 +15,7 @@ Return `true` _if it is possible to print the matrix_ `targetGrid`_,_ _otherwise ![](https://assets.leetcode.com/uploads/2021/12/23/print1.jpg) -**Input:** targetGrid = [[1,1,1,1],[1,2,2,1],[1,2,2,1],[1,1,1,1]] +**Input:** targetGrid = \[\[1,1,1,1],[1,2,2,1],[1,2,2,1],[1,1,1,1]] **Output:** true @@ -23,13 +23,13 @@ Return `true` _if it is possible to print the matrix_ `targetGrid`_,_ _otherwise ![](https://assets.leetcode.com/uploads/2021/12/23/print2.jpg) -**Input:** targetGrid = [[1,1,1,1],[1,1,3,3],[1,1,3,4],[5,5,1,4]] +**Input:** targetGrid = \[\[1,1,1,1],[1,1,3,3],[1,1,3,4],[5,5,1,4]] **Output:** true **Example 3:** -**Input:** targetGrid = [[1,2,1],[2,1,2],[1,2,1]] +**Input:** targetGrid = \[\[1,2,1],[2,1,2],[1,2,1]] **Output:** false diff --git a/src/main/java/g1501_1600/s1594_maximum_non_negative_product_in_a_matrix/readme.md b/src/main/java/g1501_1600/s1594_maximum_non_negative_product_in_a_matrix/readme.md index 216f40cd..a4a62031 100644 --- a/src/main/java/g1501_1600/s1594_maximum_non_negative_product_in_a_matrix/readme.md +++ b/src/main/java/g1501_1600/s1594_maximum_non_negative_product_in_a_matrix/readme.md @@ -14,7 +14,7 @@ Notice that the modulo is performed after getting the maximum product. ![](https://assets.leetcode.com/uploads/2021/12/23/product1.jpg) -**Input:** grid = [[-1,-2,-3],[-2,-3,-3],[-3,-3,-2]] +**Input:** grid = \[\[-1,-2,-3],[-2,-3,-3],[-3,-3,-2]] **Output:** -1 @@ -24,7 +24,7 @@ Notice that the modulo is performed after getting the maximum product. ![](https://assets.leetcode.com/uploads/2021/12/23/product2.jpg) -**Input:** grid = [[1,-2,1],[1,-2,1],[3,-4,1]] +**Input:** grid = \[\[1,-2,1],[1,-2,1],[3,-4,1]] **Output:** 8 @@ -34,7 +34,7 @@ Notice that the modulo is performed after getting the maximum product. ![](https://assets.leetcode.com/uploads/2021/12/23/product3.jpg) -**Input:** grid = [[1,3],[0,-4]] +**Input:** grid = \[\[1,3],[0,-4]] **Output:** 0 diff --git a/src/main/java/g1501_1600/s1595_minimum_cost_to_connect_two_groups_of_points/readme.md b/src/main/java/g1501_1600/s1595_minimum_cost_to_connect_two_groups_of_points/readme.md index 2a7f6099..bdde14ea 100644 --- a/src/main/java/g1501_1600/s1595_minimum_cost_to_connect_two_groups_of_points/readme.md +++ b/src/main/java/g1501_1600/s1595_minimum_cost_to_connect_two_groups_of_points/readme.md @@ -12,7 +12,7 @@ Return _the minimum cost it takes to connect the two groups_. ![](https://assets.leetcode.com/uploads/2020/09/03/ex1.jpg) -**Input:** cost = [[15, 96], [36, 2]] +**Input:** cost = \[\[15, 96], [36, 2]] **Output:** 17 @@ -28,7 +28,7 @@ This results in a total cost of 17. ![](https://assets.leetcode.com/uploads/2020/09/03/ex2.jpg) -**Input:** cost = [[1, 3, 5], [4, 1, 1], [1, 5, 3]] +**Input:** cost = \[\[1, 3, 5], [4, 1, 1], [1, 5, 3]] **Output:** 4 @@ -50,7 +50,7 @@ This does not matter as there is no limit to the number of points that can be co **Example 3:** -**Input:** cost = [[2, 5, 1], [3, 4, 7], [8, 1, 2], [6, 2, 4], [3, 8, 8]] +**Input:** cost = \[\[2, 5, 1], [3, 4, 7], [8, 1, 2], [6, 2, 4], [3, 8, 8]] **Output:** 10 diff --git a/src/main/java/g1601_1700/s1601_maximum_number_of_achievable_transfer_requests/readme.md b/src/main/java/g1601_1700/s1601_maximum_number_of_achievable_transfer_requests/readme.md index 26f218a9..333477a5 100644 --- a/src/main/java/g1601_1700/s1601_maximum_number_of_achievable_transfer_requests/readme.md +++ b/src/main/java/g1601_1700/s1601_maximum_number_of_achievable_transfer_requests/readme.md @@ -14,7 +14,7 @@ Return _the maximum number of achievable requests_. ![](https://assets.leetcode.com/uploads/2020/09/10/move1.jpg) -**Input:** n = 5, requests = [[0,1],[1,0],[0,1],[1,2],[2,0],[3,4]] +**Input:** n = 5, requests = \[\[0,1],[1,0],[0,1],[1,2],[2,0],[3,4]] **Output:** 5 **Explantion:** Let's see the requests: @@ -36,7 +36,7 @@ We can achieve the requests of users y, a and z by swapping the places in the 3 ![](https://assets.leetcode.com/uploads/2020/09/10/move2.jpg) -**Input:** n = 3, requests = [[0,0],[1,2],[2,1]] +**Input:** n = 3, requests = \[\[0,0],[1,2],[2,1]] **Output:** 3 **Explantion:** Let's see the requests: @@ -50,7 +50,7 @@ We can achieve all the requests. **Example 3:** -**Input:** n = 4, requests = [[0,3],[3,1],[1,2],[2,0]] +**Input:** n = 4, requests = \[\[0,3],[3,1],[1,2],[2,0]] **Output:** 4 diff --git a/src/main/java/g1601_1700/s1610_maximum_number_of_visible_points/readme.md b/src/main/java/g1601_1700/s1610_maximum_number_of_visible_points/readme.md index 9fde885f..30ea99fa 100644 --- a/src/main/java/g1601_1700/s1610_maximum_number_of_visible_points/readme.md +++ b/src/main/java/g1601_1700/s1610_maximum_number_of_visible_points/readme.md @@ -18,7 +18,7 @@ Return _the maximum number of points you can see_. ![](https://assets.leetcode.com/uploads/2020/09/30/89a07e9b-00ab-4967-976a-c723b2aa8656.png) -**Input:** points = [[2,1],[2,2],[3,3]], angle = 90, location = [1,1] +**Input:** points = \[\[2,1],[2,2],[3,3]], angle = 90, location = [1,1] **Output:** 3 @@ -26,7 +26,7 @@ Return _the maximum number of points you can see_. **Example 2:** -**Input:** points = [[2,1],[2,2],[3,4],[1,1]], angle = 90, location = [1,1] +**Input:** points = \[\[2,1],[2,2],[3,4],[1,1]], angle = 90, location = [1,1] **Output:** 4 @@ -36,7 +36,7 @@ Return _the maximum number of points you can see_. ![](https://assets.leetcode.com/uploads/2020/09/30/5010bfd3-86e6-465f-ac64-e9df941d2e49.png) -**Input:** points = [[1,0],[2,1]], angle = 13, location = [1,1] +**Input:** points = \[\[1,0],[2,1]], angle = 13, location = [1,1] **Output:** 1 diff --git a/src/main/java/g1601_1700/s1615_maximal_network_rank/readme.md b/src/main/java/g1601_1700/s1615_maximal_network_rank/readme.md index f0576623..beea4bd8 100644 --- a/src/main/java/g1601_1700/s1615_maximal_network_rank/readme.md +++ b/src/main/java/g1601_1700/s1615_maximal_network_rank/readme.md @@ -14,7 +14,7 @@ Given the integer `n` and the array `roads`, return _the **maximal network rank* **![](https://assets.leetcode.com/uploads/2020/09/21/ex1.png)** -**Input:** n = 4, roads = [[0,1],[0,3],[1,2],[1,3]] +**Input:** n = 4, roads = \[\[0,1],[0,3],[1,2],[1,3]] **Output:** 4 @@ -24,7 +24,7 @@ Given the integer `n` and the array `roads`, return _the **maximal network rank* **![](https://assets.leetcode.com/uploads/2020/09/21/ex2.png)** -**Input:** n = 5, roads = [[0,1],[0,3],[1,2],[1,3],[2,3],[2,4]] +**Input:** n = 5, roads = \[\[0,1],[0,3],[1,2],[1,3],[2,3],[2,4]] **Output:** 5 @@ -32,7 +32,7 @@ Given the integer `n` and the array `roads`, return _the **maximal network rank* **Example 3:** -**Input:** n = 8, roads = [[0,1],[1,2],[2,3],[2,4],[5,6],[5,7]] +**Input:** n = 8, roads = \[\[0,1],[1,2],[2,3],[2,4],[5,6],[5,7]] **Output:** 5 diff --git a/src/main/java/g1601_1700/s1617_count_subtrees_with_max_distance_between_cities/readme.md b/src/main/java/g1601_1700/s1617_count_subtrees_with_max_distance_between_cities/readme.md index d658ed49..3d1722f6 100644 --- a/src/main/java/g1601_1700/s1617_count_subtrees_with_max_distance_between_cities/readme.md +++ b/src/main/java/g1601_1700/s1617_count_subtrees_with_max_distance_between_cities/readme.md @@ -16,7 +16,7 @@ Return _an array of size_ `n-1` _where the_ dth _element **![](https://assets.leetcode.com/uploads/2020/09/21/p1.png)** -**Input:** n = 4, edges = [[1,2],[2,3],[2,4]] +**Input:** n = 4, edges = \[\[1,2],[2,3],[2,4]] **Output:** [3,4,0] @@ -30,13 +30,13 @@ No subtree has two nodes where the max distance between them is 3. **Example 2:** -**Input:** n = 2, edges = [[1,2]] +**Input:** n = 2, edges = \[\[1,2]] **Output:** [1] **Example 3:** -**Input:** n = 3, edges = [[1,2],[2,3]] +**Input:** n = 3, edges = \[\[1,2],[2,3]] **Output:** [2,1] diff --git a/src/main/java/g1601_1700/s1620_coordinate_with_maximum_network_quality/readme.md b/src/main/java/g1601_1700/s1620_coordinate_with_maximum_network_quality/readme.md index 675d7305..4c9e28fd 100644 --- a/src/main/java/g1601_1700/s1620_coordinate_with_maximum_network_quality/readme.md +++ b/src/main/java/g1601_1700/s1620_coordinate_with_maximum_network_quality/readme.md @@ -21,7 +21,7 @@ Return _the array_ [cx, cy] _representing the ![](https://assets.leetcode.com/uploads/2020/09/22/untitled-diagram.png) -**Input:** towers = [[1,2,5],[2,1,7],[3,1,9]], radius = 2 +**Input:** towers = \[\[1,2,5],[2,1,7],[3,1,9]], radius = 2 **Output:** [2,1] @@ -37,7 +37,7 @@ No other coordinate has a higher network quality. **Example 2:** -**Input:** towers = [[23,11,21]], radius = 9 +**Input:** towers = \[\[23,11,21]], radius = 9 **Output:** [23,11] @@ -45,7 +45,7 @@ No other coordinate has a higher network quality. **Example 3:** -**Input:** towers = [[1,2,13],[2,1,7],[0,1,9]], radius = 2 +**Input:** towers = \[\[1,2,13],[2,1,7],[0,1,9]], radius = 2 **Output:** [1,2] diff --git a/src/main/java/g1601_1700/s1627_graph_connectivity_with_threshold/readme.md b/src/main/java/g1601_1700/s1627_graph_connectivity_with_threshold/readme.md index 2dd0b212..fb75afcb 100644 --- a/src/main/java/g1601_1700/s1627_graph_connectivity_with_threshold/readme.md +++ b/src/main/java/g1601_1700/s1627_graph_connectivity_with_threshold/readme.md @@ -16,7 +16,7 @@ Return _an array_ `answer`_, where_ `answer.length == queries.length` _and_ `ans ![](https://assets.leetcode.com/uploads/2020/10/09/ex1.jpg) -**Input:** n = 6, threshold = 2, queries = [[1,4],[2,5],[3,6]] +**Input:** n = 6, threshold = 2, queries = \[\[1,4],[2,5],[3,6]] **Output:** [false,false,true] @@ -46,7 +46,7 @@ Using the underlined divisors above the threshold, only cities 3 and 6 share a c ![](https://assets.leetcode.com/uploads/2020/10/10/tmp.jpg) -**Input:** n = 6, threshold = 0, queries = [[4,5],[3,4],[3,2],[2,6],[1,3]] +**Input:** n = 6, threshold = 0, queries = \[\[4,5],[3,4],[3,2],[2,6],[1,3]] **Output:** [true,true,true,true,true] @@ -56,7 +56,7 @@ Using the underlined divisors above the threshold, only cities 3 and 6 share a c ![](https://assets.leetcode.com/uploads/2020/10/17/ex3.jpg) -**Input:** n = 5, threshold = 1, queries = [[4,5],[4,5],[3,2],[2,3],[3,4]] +**Input:** n = 5, threshold = 1, queries = \[\[4,5],[4,5],[3,2],[2,3],[3,4]] **Output:** [false,false,false,false,false] diff --git a/src/main/java/g1601_1700/s1631_path_with_minimum_effort/readme.md b/src/main/java/g1601_1700/s1631_path_with_minimum_effort/readme.md index 23104458..dcc3c63f 100644 --- a/src/main/java/g1601_1700/s1631_path_with_minimum_effort/readme.md +++ b/src/main/java/g1601_1700/s1631_path_with_minimum_effort/readme.md @@ -12,7 +12,7 @@ Return _the minimum **effort** required to travel from the top-left cell to the ![](https://assets.leetcode.com/uploads/2020/10/04/ex1.png) -**Input:** heights = [[1,2,2],[3,8,2],[5,3,5]] +**Input:** heights = \[\[1,2,2],[3,8,2],[5,3,5]] **Output:** 2 @@ -22,7 +22,7 @@ Return _the minimum **effort** required to travel from the top-left cell to the ![](https://assets.leetcode.com/uploads/2020/10/04/ex2.png) -**Input:** heights = [[1,2,3],[3,8,4],[5,3,5]] +**Input:** heights = \[\[1,2,3],[3,8,4],[5,3,5]] **Output:** 1 @@ -32,7 +32,7 @@ Return _the minimum **effort** required to travel from the top-left cell to the ![](https://assets.leetcode.com/uploads/2020/10/04/ex3.png) -**Input:** heights = [[1,2,1,1,1],[1,2,1,2,1],[1,2,1,2,1],[1,2,1,2,1],[1,1,1,2,1]] +**Input:** heights = \[\[1,2,1,1,1],[1,2,1,2,1],[1,2,1,2,1],[1,2,1,2,1],[1,1,1,2,1]] **Output:** 0 diff --git a/src/main/java/g1601_1700/s1632_rank_transform_of_a_matrix/readme.md b/src/main/java/g1601_1700/s1632_rank_transform_of_a_matrix/readme.md index f3b2241d..2897a994 100644 --- a/src/main/java/g1601_1700/s1632_rank_transform_of_a_matrix/readme.md +++ b/src/main/java/g1601_1700/s1632_rank_transform_of_a_matrix/readme.md @@ -19,7 +19,7 @@ The test cases are generated so that `answer` is unique under the given rules. ![](https://assets.leetcode.com/uploads/2020/10/18/rank1.jpg) -**Input:** matrix = [[1,2],[3,4]] +**Input:** matrix = \[\[1,2],[3,4]] **Output:** [[1,2],[2,3]] @@ -37,7 +37,7 @@ The rank of matrix[1][1] is 3 because matrix[1][1] > matrix[0][1], matrix[1][1] ![](https://assets.leetcode.com/uploads/2020/10/18/rank2.jpg) -**Input:** matrix = [[7,7],[7,7]] +**Input:** matrix = \[\[7,7],[7,7]] **Output:** [[1,1],[1,1]] @@ -45,7 +45,7 @@ The rank of matrix[1][1] is 3 because matrix[1][1] > matrix[0][1], matrix[1][1] ![](https://assets.leetcode.com/uploads/2020/10/18/rank3.jpg) -**Input:** matrix = [[20,-21,14],[-19,4,19],[22,-47,24],[-19,4,19]] +**Input:** matrix = \[\[20,-21,14],[-19,4,19],[22,-47,24],[-19,4,19]] **Output:** [[4,2,3],[1,3,4],[5,1,6],[1,3,4]] diff --git a/src/main/java/g1601_1700/s1637_widest_vertical_area_between_two_points_containing_no_points/readme.md b/src/main/java/g1601_1700/s1637_widest_vertical_area_between_two_points_containing_no_points/readme.md index 2b8e4088..44a5e058 100644 --- a/src/main/java/g1601_1700/s1637_widest_vertical_area_between_two_points_containing_no_points/readme.md +++ b/src/main/java/g1601_1700/s1637_widest_vertical_area_between_two_points_containing_no_points/readme.md @@ -12,7 +12,7 @@ Note that points **on the edge** of a vertical area **are not** considered inclu ![](https://assets.leetcode.com/uploads/2020/09/19/points3.png) -**Input:** points = [[8,7],[9,9],[7,4],[9,7]] +**Input:** points = \[\[8,7],[9,9],[7,4],[9,7]] **Output:** 1 @@ -20,7 +20,7 @@ Note that points **on the edge** of a vertical area **are not** considered inclu **Example 2:** -**Input:** points = [[3,1],[9,0],[1,0],[1,4],[5,3],[8,8]] +**Input:** points = \[\[3,1],[9,0],[1,0],[1,4],[5,3],[8,8]] **Output:** 3 diff --git a/src/main/java/g1601_1700/s1640_check_array_formation_through_concatenation/readme.md b/src/main/java/g1601_1700/s1640_check_array_formation_through_concatenation/readme.md index 30993615..50724f18 100644 --- a/src/main/java/g1601_1700/s1640_check_array_formation_through_concatenation/readme.md +++ b/src/main/java/g1601_1700/s1640_check_array_formation_through_concatenation/readme.md @@ -8,7 +8,7 @@ Return `true` _if it is possible_ _to form the array_ `arr` _from_ `pieces`. Oth **Example 1:** -**Input:** arr = [15,88], pieces = [[88],[15]] +**Input:** arr = [15,88], pieces = \[\[88],[15]] **Output:** true @@ -16,7 +16,7 @@ Return `true` _if it is possible_ _to form the array_ `arr` _from_ `pieces`. Oth **Example 2:** -**Input:** arr = [49,18,16], pieces = [[16,18,49]] +**Input:** arr = [49,18,16], pieces = \[\[16,18,49]] **Output:** false @@ -24,7 +24,7 @@ Return `true` _if it is possible_ _to form the array_ `arr` _from_ `pieces`. Oth **Example 3:** -**Input:** arr = [91,4,64,78], pieces = [[78],[4,64],[91]] +**Input:** arr = [91,4,64,78], pieces = \[\[78],[4,64],[91]] **Output:** true diff --git a/src/main/java/g1601_1700/s1665_minimum_initial_energy_to_finish_tasks/readme.md b/src/main/java/g1601_1700/s1665_minimum_initial_energy_to_finish_tasks/readme.md index 9763e373..58c906a1 100644 --- a/src/main/java/g1601_1700/s1665_minimum_initial_energy_to_finish_tasks/readme.md +++ b/src/main/java/g1601_1700/s1665_minimum_initial_energy_to_finish_tasks/readme.md @@ -15,7 +15,7 @@ Return _the **minimum** initial amount of energy you will need_ _to finish all t **Example 1:** -**Input:** tasks = [[1,2],[2,4],[4,8]] +**Input:** tasks = \[\[1,2],[2,4],[4,8]] **Output:** 8 @@ -33,7 +33,7 @@ Notice that even though we have leftover energy, starting with 7 energy does not **Example 2:** -**Input:** tasks = [[1,3],[2,4],[10,11],[10,12],[8,9]] +**Input:** tasks = \[\[1,3],[2,4],[10,11],[10,12],[8,9]] **Output:** 32 @@ -53,7 +53,7 @@ Starting with 32 energy, we finish the tasks in the following order: **Example 3:** -**Input:** tasks = [[1,7],[2,8],[3,9],[4,10],[5,11],[6,12]] +**Input:** tasks = \[\[1,7],[2,8],[3,9],[4,10],[5,11],[6,12]] **Output:** 27 diff --git a/src/main/java/g1601_1700/s1672_richest_customer_wealth/readme.md b/src/main/java/g1601_1700/s1672_richest_customer_wealth/readme.md index 745b15fc..c7a73bab 100644 --- a/src/main/java/g1601_1700/s1672_richest_customer_wealth/readme.md +++ b/src/main/java/g1601_1700/s1672_richest_customer_wealth/readme.md @@ -8,7 +8,7 @@ A customer's **wealth** is the amount of money they have in all their bank accou **Example 1:** -**Input:** accounts = [[1,2,3],[3,2,1]] +**Input:** accounts = \[\[1,2,3],[3,2,1]] **Output:** 6 @@ -22,7 +22,7 @@ Both customers are considered the richest with a wealth of 6 each, so return 6. **Example 2:** -**Input:** accounts = [[1,5],[7,3],[3,5]] +**Input:** accounts = \[\[1,5],[7,3],[3,5]] **Output:** 10 @@ -38,7 +38,7 @@ The 2nd customer is the richest with a wealth of 10. **Example 3:** -**Input:** accounts = [[2,8,7],[7,1,3],[1,9,5]] +**Input:** accounts = \[\[2,8,7],[7,1,3],[1,9,5]] **Output:** 17 diff --git a/src/main/java/g1601_1700/s1687_delivering_boxes_from_storage_to_ports/readme.md b/src/main/java/g1601_1700/s1687_delivering_boxes_from_storage_to_ports/readme.md index 269be863..33f473de 100644 --- a/src/main/java/g1601_1700/s1687_delivering_boxes_from_storage_to_ports/readme.md +++ b/src/main/java/g1601_1700/s1687_delivering_boxes_from_storage_to_ports/readme.md @@ -22,7 +22,7 @@ Return _the **minimum** number of **trips** the ship needs to make to deliver al **Example 1:** -**Input:** boxes = [[1,1],[2,1],[1,1]], portsCount = 2, maxBoxes = 3, maxWeight = 3 +**Input:** boxes = \[\[1,1],[2,1],[1,1]], portsCount = 2, maxBoxes = 3, maxWeight = 3 **Output:** 4 @@ -36,7 +36,7 @@ Note that the first and third boxes cannot be delivered together because the box **Example 2:** -**Input:** boxes = [[1,2],[3,3],[3,1],[3,1],[2,4]], portsCount = 3, maxBoxes = 3, maxWeight = 6 +**Input:** boxes = \[\[1,2],[3,3],[3,1],[3,1],[2,4]], portsCount = 3, maxBoxes = 3, maxWeight = 6 **Output:** 6 @@ -44,7 +44,7 @@ Note that the first and third boxes cannot be delivered together because the box **Example 3:** -**Input:** boxes = [[1,4],[1,2],[2,1],[2,1],[3,2],[3,4]], portsCount = 3, maxBoxes = 6, maxWeight = 7 +**Input:** boxes = \[\[1,4],[1,2],[2,1],[2,1],[3,2],[3,4]], portsCount = 3, maxBoxes = 6, maxWeight = 7 **Output:** 6 diff --git a/src/main/java/g1601_1700/s1691_maximum_height_by_stacking_cuboids/readme.md b/src/main/java/g1601_1700/s1691_maximum_height_by_stacking_cuboids/readme.md index e6cd05f3..5f45d0b1 100644 --- a/src/main/java/g1601_1700/s1691_maximum_height_by_stacking_cuboids/readme.md +++ b/src/main/java/g1601_1700/s1691_maximum_height_by_stacking_cuboids/readme.md @@ -12,7 +12,7 @@ Return _the **maximum height** of the stacked_ `cuboids`. **![](https://assets.leetcode.com/uploads/2019/10/21/image.jpg)** -**Input:** cuboids = [[50,45,20],[95,37,53],[45,23,12]] +**Input:** cuboids = \[\[50,45,20],[95,37,53],[45,23,12]] **Output:** 190 @@ -28,7 +28,7 @@ The total height is 95 + 50 + 45 = 190. **Example 2:** -**Input:** cuboids = [[38,25,45],[76,35,3]] +**Input:** cuboids = \[\[38,25,45],[76,35,3]] **Output:** 76 @@ -40,7 +40,7 @@ We choose cuboid 1 and rotate it so that the 35x3 side is facing down and its he **Example 3:** -**Input:** cuboids = [[7,11,17],[7,17,11],[11,7,17],[11,17,7],[17,7,11],[17,11,7]] +**Input:** cuboids = \[\[7,11,17],[7,17,11],[11,7,17],[11,17,7],[17,7,11],[17,11,7]] **Output:** 102 diff --git a/src/main/java/g1601_1700/s1697_checking_existence_of_edge_length_limited_paths/readme.md b/src/main/java/g1601_1700/s1697_checking_existence_of_edge_length_limited_paths/readme.md index e69380a1..05851475 100644 --- a/src/main/java/g1601_1700/s1697_checking_existence_of_edge_length_limited_paths/readme.md +++ b/src/main/java/g1601_1700/s1697_checking_existence_of_edge_length_limited_paths/readme.md @@ -12,7 +12,7 @@ Return _a **boolean array**_ `answer`_, where_ `answer.length == queries.length` ![](https://assets.leetcode.com/uploads/2020/12/08/h.png) -**Input:** n = 3, edgeList = [[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = [[0,1,2],[0,2,5]] +**Input:** n = 3, edgeList = \[\[0,1,2],[1,2,4],[2,0,8],[1,0,16]], queries = \[\[0,1,2],[0,2,5]] **Output:** [false,true] @@ -26,7 +26,7 @@ For the second query, there is a path (0 -> 1 -> 2) of two edges with distances ![](https://assets.leetcode.com/uploads/2020/12/08/q.png) -**Input:** n = 5, edgeList = [[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = [[0,4,14],[1,4,13]] +**Input:** n = 5, edgeList = \[\[0,1,10],[1,2,5],[2,3,9],[3,4,13]], queries = \[\[0,4,14],[1,4,13]] **Output:** [true,false] **Exaplanation:** The above figure shows the given graph. diff --git a/src/main/java/g1701_1800/s1701_average_waiting_time/readme.md b/src/main/java/g1701_1800/s1701_average_waiting_time/readme.md index cf2df1ed..199633bc 100644 --- a/src/main/java/g1701_1800/s1701_average_waiting_time/readme.md +++ b/src/main/java/g1701_1800/s1701_average_waiting_time/readme.md @@ -13,7 +13,7 @@ Return _the **average** waiting time of all customers_. Solutions within 1 **Example 1:** -**Input:** customers = [[1,2],[2,5],[4,3]] +**Input:** customers = \[\[1,2],[2,5],[4,3]] **Output:** 5.00000 @@ -27,7 +27,7 @@ Return _the **average** waiting time of all customers_. Solutions within 1 **Example 2:** -**Input:** customers = [[5,2],[5,4],[10,3],[20,1]] +**Input:** customers = \[\[5,2],[5,4],[10,3],[20,1]] **Output:** 3.25000 diff --git a/src/main/java/g1701_1800/s1706_where_will_the_ball_fall/readme.md b/src/main/java/g1701_1800/s1706_where_will_the_ball_fall/readme.md index 207e9014..41e62863 100644 --- a/src/main/java/g1701_1800/s1706_where_will_the_ball_fall/readme.md +++ b/src/main/java/g1701_1800/s1706_where_will_the_ball_fall/readme.md @@ -17,7 +17,7 @@ Return _an array_ `answer` _of size_ `n` _where_ `answer[i]` _is the column that **![](https://assets.leetcode.com/uploads/2019/09/26/ball.jpg)** -**Input:** grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]] +**Input:** grid = \[\[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]] **Output:** [1,-1,-1,-1,-1] @@ -35,7 +35,7 @@ Ball b4 is dropped at column 4 and will get stuck on the box between column 2 an **Example 2:** -**Input:** grid = [[-1]] +**Input:** grid = \[\[-1]] **Output:** [-1] @@ -43,7 +43,7 @@ Ball b4 is dropped at column 4 and will get stuck on the box between column 2 an **Example 3:** -**Input:** grid = [[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1],[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1]] +**Input:** grid = \[\[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1],[1,1,1,1,1,1],[-1,-1,-1,-1,-1,-1]] **Output:** [0,1,2,3,4,-1] diff --git a/src/main/java/g1701_1800/s1707_maximum_xor_with_an_element_from_array/readme.md b/src/main/java/g1701_1800/s1707_maximum_xor_with_an_element_from_array/readme.md index 01d25a58..eb0f7543 100644 --- a/src/main/java/g1701_1800/s1707_maximum_xor_with_an_element_from_array/readme.md +++ b/src/main/java/g1701_1800/s1707_maximum_xor_with_an_element_from_array/readme.md @@ -10,7 +10,7 @@ Return _an integer array_ `answer` _where_ `answer.length == queries.length` _an **Example 1:** -**Input:** nums = [0,1,2,3,4], queries = [[3,1],[1,3],[5,6]] +**Input:** nums = [0,1,2,3,4], queries = \[\[3,1],[1,3],[5,6]] **Output:** [3,3,7] @@ -24,7 +24,7 @@ Return _an integer array_ `answer` _where_ `answer.length == queries.length` _an **Example 2:** -**Input:** nums = [5,2,4,6,6,3], queries = [[12,4],[8,1],[6,3]] +**Input:** nums = [5,2,4,6,6,3], queries = \[\[12,4],[8,1],[6,3]] **Output:** [15,-1,5] diff --git a/src/main/java/g1701_1800/s1710_maximum_units_on_a_truck/readme.md b/src/main/java/g1701_1800/s1710_maximum_units_on_a_truck/readme.md index af39920d..db0f8808 100644 --- a/src/main/java/g1701_1800/s1710_maximum_units_on_a_truck/readme.md +++ b/src/main/java/g1701_1800/s1710_maximum_units_on_a_truck/readme.md @@ -13,7 +13,7 @@ Return _the **maximum** total number of **units** that can be put on the truck._ **Example 1:** -**Input:** boxTypes = [[1,3],[2,2],[3,1]], truckSize = 4 +**Input:** boxTypes = \[\[1,3],[2,2],[3,1]], truckSize = 4 **Output:** 8 @@ -27,7 +27,7 @@ Return _the **maximum** total number of **units** that can be put on the truck._ **Example 2:** -**Input:** boxTypes = [[5,10],[2,5],[4,7],[3,9]], truckSize = 10 +**Input:** boxTypes = \[\[5,10],[2,5],[4,7],[3,9]], truckSize = 10 **Output:** 91 diff --git a/src/main/java/g1701_1800/s1719_number_of_ways_to_reconstruct_a_tree/readme.md b/src/main/java/g1701_1800/s1719_number_of_ways_to_reconstruct_a_tree/readme.md index 97ae9625..b7eb6648 100644 --- a/src/main/java/g1701_1800/s1719_number_of_ways_to_reconstruct_a_tree/readme.md +++ b/src/main/java/g1701_1800/s1719_number_of_ways_to_reconstruct_a_tree/readme.md @@ -29,7 +29,7 @@ An **ancestor** of a node is any node on the path from the root to that node (ex ![](https://assets.leetcode.com/uploads/2020/12/03/trees2.png) -**Input:** pairs = [[1,2],[2,3]] +**Input:** pairs = \[\[1,2],[2,3]] **Output:** 1 @@ -39,7 +39,7 @@ An **ancestor** of a node is any node on the path from the root to that node (ex ![](https://assets.leetcode.com/uploads/2020/12/03/tree.png) -**Input:** pairs = [[1,2],[2,3],[1,3]] +**Input:** pairs = \[\[1,2],[2,3],[1,3]] **Output:** 2 @@ -47,7 +47,7 @@ An **ancestor** of a node is any node on the path from the root to that node (ex **Example 3:** -**Input:** pairs = [[1,2],[2,3],[2,4],[1,5]] +**Input:** pairs = \[\[1,2],[2,3],[2,4],[1,5]] **Output:** 0 diff --git a/src/main/java/g1701_1800/s1722_minimize_hamming_distance_after_swap_operations/readme.md b/src/main/java/g1701_1800/s1722_minimize_hamming_distance_after_swap_operations/readme.md index c69f6d78..d6a47902 100644 --- a/src/main/java/g1701_1800/s1722_minimize_hamming_distance_after_swap_operations/readme.md +++ b/src/main/java/g1701_1800/s1722_minimize_hamming_distance_after_swap_operations/readme.md @@ -10,7 +10,7 @@ Return _the **minimum Hamming distance** of_ `source` _and_ `target` _after perf **Example 1:** -**Input:** source = [1,2,3,4], target = [2,1,4,5], allowedSwaps = [[0,1],[2,3]] +**Input:** source = [1,2,3,4], target = [2,1,4,5], allowedSwaps = \[\[0,1],[2,3]] **Output:** 1 @@ -32,7 +32,7 @@ The Hamming distance of source and target is 1 as they differ in 1 position: ind **Example 3:** -**Input:** source = [5,1,2,4,3], target = [1,5,4,2,3], allowedSwaps = [[0,4],[4,2],[1,3],[1,4]] +**Input:** source = [5,1,2,4,3], target = [1,5,4,2,3], allowedSwaps = \[\[0,4],[4,2],[1,3],[1,4]] **Output:** 0 diff --git a/src/main/java/g1701_1800/s1725_number_of_rectangles_that_can_form_the_largest_square/readme.md b/src/main/java/g1701_1800/s1725_number_of_rectangles_that_can_form_the_largest_square/readme.md index 279bbcb2..21a8eeba 100644 --- a/src/main/java/g1701_1800/s1725_number_of_rectangles_that_can_form_the_largest_square/readme.md +++ b/src/main/java/g1701_1800/s1725_number_of_rectangles_that_can_form_the_largest_square/readme.md @@ -12,7 +12,7 @@ Return _the **number** of rectangles that can make a square with a side length o **Example 1:** -**Input:** rectangles = [[5,8],[3,9],[5,12],[16,5]] +**Input:** rectangles = \[\[5,8],[3,9],[5,12],[16,5]] **Output:** 3 @@ -20,7 +20,7 @@ Return _the **number** of rectangles that can make a square with a side length o **Example 2:** -**Input:** rectangles = [[2,3],[3,7],[4,3],[3,7]] +**Input:** rectangles = \[\[2,3],[3,7],[4,3],[3,7]] **Output:** 3 diff --git a/src/main/java/g1701_1800/s1727_largest_submatrix_with_rearrangements/readme.md b/src/main/java/g1701_1800/s1727_largest_submatrix_with_rearrangements/readme.md index f5da73e8..2c3274fd 100644 --- a/src/main/java/g1701_1800/s1727_largest_submatrix_with_rearrangements/readme.md +++ b/src/main/java/g1701_1800/s1727_largest_submatrix_with_rearrangements/readme.md @@ -10,7 +10,7 @@ Return _the area of the largest submatrix within_ `matrix` _where **every** elem ![](https://assets.leetcode.com/uploads/2020/12/29/screenshot-2020-12-30-at-40536-pm.png) -**Input:** matrix = [[0,0,1],[1,1,1],[1,0,1]] +**Input:** matrix = \[\[0,0,1],[1,1,1],[1,0,1]] **Output:** 4 @@ -20,7 +20,7 @@ Return _the area of the largest submatrix within_ `matrix` _where **every** elem ![](https://assets.leetcode.com/uploads/2020/12/29/screenshot-2020-12-30-at-40852-pm.png) -**Input:** matrix = [[1,0,1,0,1]] +**Input:** matrix = \[\[1,0,1,0,1]] **Output:** 3 @@ -28,7 +28,7 @@ Return _the area of the largest submatrix within_ `matrix` _where **every** elem **Example 3:** -**Input:** matrix = [[1,1,0],[1,0,1]] +**Input:** matrix = \[\[1,1,0],[1,0,1]] **Output:** 2 diff --git a/src/main/java/g1701_1800/s1733_minimum_number_of_people_to_teach/readme.md b/src/main/java/g1701_1800/s1733_minimum_number_of_people_to_teach/readme.md index 5c672ed9..844641ea 100644 --- a/src/main/java/g1701_1800/s1733_minimum_number_of_people_to_teach/readme.md +++ b/src/main/java/g1701_1800/s1733_minimum_number_of_people_to_teach/readme.md @@ -16,7 +16,7 @@ Note that friendships are not transitive, meaning if `x` is a friend of `y` and **Example 1:** -**Input:** n = 2, languages = [[1],[2],[1,2]], friendships = [[1,2],[1,3],[2,3]] +**Input:** n = 2, languages = \[\[1],[2],[1,2]], friendships = \[\[1,2],[1,3],[2,3]] **Output:** 1 @@ -24,7 +24,7 @@ Note that friendships are not transitive, meaning if `x` is a friend of `y` and **Example 2:** -**Input:** n = 3, languages = [[2],[1,3],[1,2],[3]], friendships = [[1,4],[1,2],[3,4],[2,3]] +**Input:** n = 3, languages = \[\[2],[1,3],[1,2],[3]], friendships = \[\[1,4],[1,2],[3,4],[2,3]] **Output:** 2 diff --git a/src/main/java/g1701_1800/s1735_count_ways_to_make_array_with_product/readme.md b/src/main/java/g1701_1800/s1735_count_ways_to_make_array_with_product/readme.md index bd815979..9ac37e60 100644 --- a/src/main/java/g1701_1800/s1735_count_ways_to_make_array_with_product/readme.md +++ b/src/main/java/g1701_1800/s1735_count_ways_to_make_array_with_product/readme.md @@ -8,7 +8,7 @@ Return _an integer array_ `answer` _where_ `answer.length == queries.length`_, a **Example 1:** -**Input:** queries = [[2,6],[5,1],[73,660]] +**Input:** queries = \[\[2,6],[5,1],[73,660]] **Output:** [4,1,50734910] @@ -22,7 +22,7 @@ Return _an integer array_ `answer` _where_ `answer.length == queries.length`_, a **Example 2:** -**Input:** queries = [[1,1],[2,2],[3,3],[4,4],[5,5]] +**Input:** queries = \[\[1,1],[2,2],[3,3],[4,4],[5,5]] **Output:** [1,2,3,10,5] diff --git a/src/main/java/g1701_1800/s1738_find_kth_largest_xor_coordinate_value/readme.md b/src/main/java/g1701_1800/s1738_find_kth_largest_xor_coordinate_value/readme.md index 6638e142..2cb401ed 100644 --- a/src/main/java/g1701_1800/s1738_find_kth_largest_xor_coordinate_value/readme.md +++ b/src/main/java/g1701_1800/s1738_find_kth_largest_xor_coordinate_value/readme.md @@ -10,7 +10,7 @@ Find the kth largest value **(1-indexed)** of all the co **Example 1:** -**Input:** matrix = [[5,2],[1,6]], k = 1 +**Input:** matrix = \[\[5,2],[1,6]], k = 1 **Output:** 7 @@ -18,7 +18,7 @@ Find the kth largest value **(1-indexed)** of all the co **Example 2:** -**Input:** matrix = [[5,2],[1,6]], k = 2 +**Input:** matrix = \[\[5,2],[1,6]], k = 2 **Output:** 5 @@ -26,7 +26,7 @@ Find the kth largest value **(1-indexed)** of all the co **Example 3:** -**Input:** matrix = [[5,2],[1,6]], k = 3 +**Input:** matrix = \[\[5,2],[1,6]], k = 3 **Output:** 4 diff --git a/src/main/java/g1701_1800/s1743_restore_the_array_from_adjacent_pairs/readme.md b/src/main/java/g1701_1800/s1743_restore_the_array_from_adjacent_pairs/readme.md index 241d9d55..15174cde 100644 --- a/src/main/java/g1701_1800/s1743_restore_the_array_from_adjacent_pairs/readme.md +++ b/src/main/java/g1701_1800/s1743_restore_the_array_from_adjacent_pairs/readme.md @@ -12,7 +12,7 @@ Return _the original array_ `nums`_. If there are multiple solutions, return **a **Example 1:** -**Input:** adjacentPairs = [[2,1],[3,4],[3,2]] +**Input:** adjacentPairs = \[\[2,1],[3,4],[3,2]] **Output:** [1,2,3,4] @@ -20,7 +20,7 @@ Return _the original array_ `nums`_. If there are multiple solutions, return **a **Example 2:** -**Input:** adjacentPairs = [[4,-2],[1,4],[-3,1]] +**Input:** adjacentPairs = \[\[4,-2],[1,4],[-3,1]] **Output:** [-2,4,1,-3] @@ -28,7 +28,7 @@ Return _the original array_ `nums`_. If there are multiple solutions, return **a **Example 3:** -**Input:** adjacentPairs = [[100000,-100000]] +**Input:** adjacentPairs = \[\[100000,-100000]] **Output:** [100000,-100000] diff --git a/src/main/java/g1701_1800/s1744_can_you_eat_your_favorite_candy_on_your_favorite_day/readme.md b/src/main/java/g1701_1800/s1744_can_you_eat_your_favorite_candy_on_your_favorite_day/readme.md index 4682c6d2..e673ae68 100644 --- a/src/main/java/g1701_1800/s1744_can_you_eat_your_favorite_candy_on_your_favorite_day/readme.md +++ b/src/main/java/g1701_1800/s1744_can_you_eat_your_favorite_candy_on_your_favorite_day/readme.md @@ -16,7 +16,7 @@ Return _the constructed array_ `answer`. **Example 1:** -**Input:** candiesCount = [7,4,5,3,8], queries = [[0,2,2],[4,2,4],[2,13,1000000000]] +**Input:** candiesCount = [7,4,5,3,8], queries = \[\[0,2,2],[4,2,4],[2,13,1000000000]] **Output:** [true,false,true] @@ -34,7 +34,7 @@ On day 2, you can only eat 4 candies (type 1 and type 2), so you cannot eat a ca **Example 2:** -**Input:** candiesCount = [5,2,6,4,1], queries = [[3,1,2],[4,10,3],[3,10,100],[4,100,30],[1,3,1]] +**Input:** candiesCount = [5,2,6,4,1], queries = \[\[3,1,2],[4,10,3],[3,10,100],[4,100,30],[1,3,1]] **Output:** [false,true,true,false,false] diff --git a/src/main/java/g1701_1800/s1751_maximum_number_of_events_that_can_be_attended_ii/readme.md b/src/main/java/g1701_1800/s1751_maximum_number_of_events_that_can_be_attended_ii/readme.md index 7359f795..e4ed50ad 100644 --- a/src/main/java/g1701_1800/s1751_maximum_number_of_events_that_can_be_attended_ii/readme.md +++ b/src/main/java/g1701_1800/s1751_maximum_number_of_events_that_can_be_attended_ii/readme.md @@ -12,7 +12,7 @@ Return _the **maximum sum** of values that you can receive by attending events._ ![](https://assets.leetcode.com/uploads/2021/01/10/screenshot-2021-01-11-at-60048-pm.png) -**Input:** events = [[1,2,4],[3,4,3],[2,3,1]], k = 2 +**Input:** events = \[\[1,2,4],[3,4,3],[2,3,1]], k = 2 **Output:** 7 @@ -22,7 +22,7 @@ Return _the **maximum sum** of values that you can receive by attending events._ ![](https://assets.leetcode.com/uploads/2021/01/10/screenshot-2021-01-11-at-60150-pm.png) -**Input:** events = [[1,2,4],[3,4,3],[2,3,10]], k = 2 +**Input:** events = \[\[1,2,4],[3,4,3],[2,3,10]], k = 2 **Output:** 10 @@ -32,7 +32,7 @@ Return _the **maximum sum** of values that you can receive by attending events._ **![](https://assets.leetcode.com/uploads/2021/01/10/screenshot-2021-01-11-at-60703-pm.png)** -**Input:** events = [[1,1,1],[2,2,2],[3,3,3],[4,4,4]], k = 3 +**Input:** events = \[\[1,1,1],[2,2,2],[3,3,3],[4,4,4]], k = 3 **Output:** 9 diff --git a/src/main/java/g1701_1800/s1761_minimum_degree_of_a_connected_trio_in_a_graph/readme.md b/src/main/java/g1701_1800/s1761_minimum_degree_of_a_connected_trio_in_a_graph/readme.md index 3aba4bfe..19fc87c8 100644 --- a/src/main/java/g1701_1800/s1761_minimum_degree_of_a_connected_trio_in_a_graph/readme.md +++ b/src/main/java/g1701_1800/s1761_minimum_degree_of_a_connected_trio_in_a_graph/readme.md @@ -14,7 +14,7 @@ Return _the **minimum** degree of a connected trio in the graph, or_ `-1` _if th ![](https://assets.leetcode.com/uploads/2021/01/26/trios1.png) -**Input:** n = 6, edges = [[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]] +**Input:** n = 6, edges = \[\[1,2],[1,3],[3,2],[4,1],[5,2],[3,6]] **Output:** 3 @@ -24,7 +24,7 @@ Return _the **minimum** degree of a connected trio in the graph, or_ `-1` _if th ![](https://assets.leetcode.com/uploads/2021/01/26/trios2.png) -**Input:** n = 7, edges = [[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]] +**Input:** n = 7, edges = \[\[1,3],[4,1],[4,3],[2,5],[5,6],[6,7],[7,5],[2,6]] **Output:** 0 diff --git a/src/main/java/g1701_1800/s1764_form_array_by_concatenating_subarrays_of_another_array/readme.md b/src/main/java/g1701_1800/s1764_form_array_by_concatenating_subarrays_of_another_array/readme.md index 86c1f4cb..fabcbd28 100644 --- a/src/main/java/g1701_1800/s1764_form_array_by_concatenating_subarrays_of_another_array/readme.md +++ b/src/main/java/g1701_1800/s1764_form_array_by_concatenating_subarrays_of_another_array/readme.md @@ -12,7 +12,7 @@ Note that the subarrays are **disjoint** if and only if there is no index `k` su **Example 1:** -**Input:** groups = [[1,-1,-1],[3,-2,0]], nums = [1,-1,0,1,-1,-1,3,-2,0] +**Input:** groups = \[\[1,-1,-1],[3,-2,0]], nums = [1,-1,0,1,-1,-1,3,-2,0] **Output:** true @@ -20,7 +20,7 @@ Note that the subarrays are **disjoint** if and only if there is no index `k` su **Example 2:** -**Input:** groups = [[10,-2],[1,2,3,4]], nums = [1,2,3,4,10,-2] +**Input:** groups = \[\[10,-2],[1,2,3,4]], nums = [1,2,3,4,10,-2] **Output:** false @@ -28,7 +28,7 @@ Note that the subarrays are **disjoint** if and only if there is no index `k` su **Example 3:** -**Input:** groups = [[1,2,3],[3,4]], nums = [7,7,1,2,3,4,7,7] +**Input:** groups = \[\[1,2,3],[3,4]], nums = [7,7,1,2,3,4,7,7] **Output:** false diff --git a/src/main/java/g1701_1800/s1765_map_of_highest_peak/readme.md b/src/main/java/g1701_1800/s1765_map_of_highest_peak/readme.md index 8486f23d..c9873643 100644 --- a/src/main/java/g1701_1800/s1765_map_of_highest_peak/readme.md +++ b/src/main/java/g1701_1800/s1765_map_of_highest_peak/readme.md @@ -21,7 +21,7 @@ Return _an integer matrix_ `height` _of size_ `m x n` _where_ `height[i][j]` _is **![](https://assets.leetcode.com/uploads/2021/01/10/screenshot-2021-01-11-at-82045-am.png)** -**Input:** isWater = [[0,1],[0,0]] +**Input:** isWater = \[\[0,1],[0,0]] **Output:** [[1,0],[2,1]] @@ -31,7 +31,7 @@ Return _an integer matrix_ `height` _of size_ `m x n` _where_ `height[i][j]` _is **![](https://assets.leetcode.com/uploads/2021/01/10/screenshot-2021-01-11-at-82050-am.png)** -**Input:** isWater = [[0,0,1],[1,0,0],[0,0,0]] +**Input:** isWater = \[\[0,0,1],[1,0,0],[0,0,0]] **Output:** [[1,1,0],[0,1,1],[1,2,2]] diff --git a/src/main/java/g1701_1800/s1766_tree_of_coprimes/readme.md b/src/main/java/g1701_1800/s1766_tree_of_coprimes/readme.md index 7ee5851b..bf9c8e8d 100644 --- a/src/main/java/g1701_1800/s1766_tree_of_coprimes/readme.md +++ b/src/main/java/g1701_1800/s1766_tree_of_coprimes/readme.md @@ -16,7 +16,7 @@ Return _an array_ `ans` _of size_ `n`, _where_ `ans[i]` _is the closest ancestor **![](https://assets.leetcode.com/uploads/2021/01/06/untitled-diagram.png)** -**Input:** nums = [2,3,3,2], edges = [[0,1],[1,2],[1,3]] +**Input:** nums = [2,3,3,2], edges = \[\[0,1],[1,2],[1,3]] **Output:** [-1,0,0,1] @@ -32,7 +32,7 @@ Return _an array_ `ans` _of size_ `n`, _where_ `ans[i]` _is the closest ancestor ![](https://assets.leetcode.com/uploads/2021/01/06/untitled-diagram1.png) -**Input:** nums = [5,6,10,2,3,6,15], edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]] +**Input:** nums = [5,6,10,2,3,6,15], edges = \[\[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]] **Output:** [-1,0,-1,0,0,0,-1] diff --git a/src/main/java/g1701_1800/s1773_count_items_matching_a_rule/readme.md b/src/main/java/g1701_1800/s1773_count_items_matching_a_rule/readme.md index 8c46859b..ab392ffe 100644 --- a/src/main/java/g1701_1800/s1773_count_items_matching_a_rule/readme.md +++ b/src/main/java/g1701_1800/s1773_count_items_matching_a_rule/readme.md @@ -14,7 +14,7 @@ Return _the number of items that match the given rule_. **Example 1:** -**Input:** items = [["phone","blue","pixel"],["computer","silver","lenovo"],["phone","gold","iphone"]], ruleKey = "color", ruleValue = "silver" +**Input:** items = \[\["phone","blue","pixel"],["computer","silver","lenovo"],["phone","gold","iphone"]], ruleKey = "color", ruleValue = "silver" **Output:** 1 @@ -22,7 +22,7 @@ Return _the number of items that match the given rule_. **Example 2:** -**Input:** items = [["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]], ruleKey = "type", ruleValue = "phone" +**Input:** items = \[\["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]], ruleKey = "type", ruleValue = "phone" **Output:** 2 diff --git a/src/main/java/g1701_1800/s1776_car_fleet_ii/readme.md b/src/main/java/g1701_1800/s1776_car_fleet_ii/readme.md index 4ea2132e..777556fe 100644 --- a/src/main/java/g1701_1800/s1776_car_fleet_ii/readme.md +++ b/src/main/java/g1701_1800/s1776_car_fleet_ii/readme.md @@ -13,7 +13,7 @@ Return an array `answer`, where `answer[i]` is the time, in seconds, at which th **Example 1:** -**Input:** cars = [[1,2],[2,1],[4,3],[7,2]] +**Input:** cars = \[\[1,2],[2,1],[4,3],[7,2]] **Output:** [1.00000,-1.00000,3.00000,-1.00000] @@ -21,7 +21,7 @@ Return an array `answer`, where `answer[i]` is the time, in seconds, at which th **Example 2:** -**Input:** cars = [[3,4],[5,4],[6,3],[9,1]] +**Input:** cars = \[\[3,4],[5,4],[6,3],[9,1]] **Output:** [2.00000,1.00000,1.50000,-1.00000] diff --git a/src/main/java/g1701_1800/s1779_find_nearest_point_that_has_the_same_x_or_y_coordinate/readme.md b/src/main/java/g1701_1800/s1779_find_nearest_point_that_has_the_same_x_or_y_coordinate/readme.md index ffa9cb98..ac60733f 100644 --- a/src/main/java/g1701_1800/s1779_find_nearest_point_that_has_the_same_x_or_y_coordinate/readme.md +++ b/src/main/java/g1701_1800/s1779_find_nearest_point_that_has_the_same_x_or_y_coordinate/readme.md @@ -10,7 +10,7 @@ The **Manhattan distance** between two points (x1, y1(x1, y1(x1, y1edges[i] = [uiedges[i] = [uijjranges[i] = [starti, e **Example 1:** -**Input:** ranges = [[1,2],[3,4],[5,6]], left = 2, right = 5 +**Input:** ranges = \[\[1,2],[3,4],[5,6]], left = 2, right = 5 **Output:** true @@ -24,7 +24,7 @@ An integer `x` is covered by an interval ranges[i] = [starti, e **Example 2:** -**Input:** ranges = [[1,10],[10,20]], left = 21, right = 21 +**Input:** ranges = \[\[1,10],[10,20]], left = 21, right = 21 **Output:** false diff --git a/src/main/java/g1801_1900/s1895_largest_magic_square/readme.md b/src/main/java/g1801_1900/s1895_largest_magic_square/readme.md index 58f037b7..12e66baf 100644 --- a/src/main/java/g1801_1900/s1895_largest_magic_square/readme.md +++ b/src/main/java/g1801_1900/s1895_largest_magic_square/readme.md @@ -10,7 +10,7 @@ Given an `m x n` integer `grid`, return _the **size** (i.e., the side length_ `k ![](https://assets.leetcode.com/uploads/2021/05/29/magicsquare-grid.jpg) -**Input:** grid = [[7,1,4,5,6],[2,5,1,6,4],[1,5,4,3,2],[1,2,7,3,4]] +**Input:** grid = \[\[7,1,4,5,6],[2,5,1,6,4],[1,5,4,3,2],[1,2,7,3,4]] **Output:** 3 @@ -28,7 +28,7 @@ Every row sum, column sum, and diagonal sum of this magic square is equal to 12. ![](https://assets.leetcode.com/uploads/2021/05/29/magicsquare2-grid.jpg) -**Input:** grid = [[5,1,3,1],[9,3,3,1],[1,3,3,8]] +**Input:** grid = \[\[5,1,3,1],[9,3,3,1],[1,3,3,8]] **Output:** 2 diff --git a/src/main/java/g1801_1900/s1899_merge_triplets_to_form_target_triplet/readme.md b/src/main/java/g1801_1900/s1899_merge_triplets_to_form_target_triplet/readme.md index 58bf287e..302afe38 100644 --- a/src/main/java/g1801_1900/s1899_merge_triplets_to_form_target_triplet/readme.md +++ b/src/main/java/g1801_1900/s1899_merge_triplets_to_form_target_triplet/readme.md @@ -13,19 +13,19 @@ Return `true` _if it is possible to obtain the_ `target` _**triplet**_ `[x, y, z **Example 1:** -**Input:** triplets = [[2,5,3],[1,8,4],[1,7,5]], target = [2,7,5] +**Input:** triplets = \[\[2,5,3],[1,8,4],[1,7,5]], target = [2,7,5] **Output:** true **Explanation:** Perform the following operations: -- Choose the first and last triplets [[2,5,3],[1,8,4],[1,7,5]]. Update the last triplet to be [max(2,1), max(5,7), max(3,5)] = [2,7,5]. triplets = [[2,5,3],[1,8,4],[2,7,5]] +- Choose the first and last triplets [[2,5,3],[1,8,4],[1,7,5]]. Update the last triplet to be [max(2,1), max(5,7), max(3,5)] = [2,7,5]. triplets = \[\[2,5,3],[1,8,4],[2,7,5]] The target triplet [2,7,5] is now an element of triplets. **Example 2:** -**Input:** triplets = [[3,4,5],[4,5,6]], target = [3,2,5] +**Input:** triplets = \[\[3,4,5],[4,5,6]], target = [3,2,5] **Output:** false @@ -33,15 +33,15 @@ The target triplet [2,7,5] is now an element of triplets. **Example 3:** -**Input:** triplets = [[2,5,3],[2,3,4],[1,2,5],[5,2,3]], target = [5,5,5] +**Input:** triplets = \[\[2,5,3],[2,3,4],[1,2,5],[5,2,3]], target = [5,5,5] **Output:** true **Explanation:** Perform the following operations: -- Choose the first and third triplets [[2,5,3],[2,3,4],[1,2,5],[5,2,3]]. Update the third triplet to be [max(2,1), max(5,2), max(3,5)] = [2,5,5]. triplets = [[2,5,3],[2,3,4],[2,5,5],[5,2,3]]. +- Choose the first and third triplets [[2,5,3],[2,3,4],[1,2,5],[5,2,3]]. Update the third triplet to be [max(2,1), max(5,2), max(3,5)] = [2,5,5]. triplets = \[\[2,5,3],[2,3,4],[2,5,5],[5,2,3]]. -- Choose the third and fourth triplets [[2,5,3],[2,3,4],[2,5,5],[5,2,3]]. Update the fourth triplet to be [max(2,5), max(5,2), max(5,3)] = [5,5,5]. triplets = [[2,5,3],[2,3,4],[2,5,5],[5,5,5]]. +- Choose the third and fourth triplets [[2,5,3],[2,3,4],[2,5,5],[5,2,3]]. Update the fourth triplet to be [max(2,5), max(5,2), max(5,3)] = [5,5,5]. triplets = \[\[2,5,3],[2,3,4],[2,5,5],[5,5,5]]. The target triplet [5,5,5] is now an element of triplets. diff --git a/src/main/java/g1901_2000/s1901_find_a_peak_element_ii/readme.md b/src/main/java/g1901_2000/s1901_find_a_peak_element_ii/readme.md index 3d33bad9..bbf48eac 100644 --- a/src/main/java/g1901_2000/s1901_find_a_peak_element_ii/readme.md +++ b/src/main/java/g1901_2000/s1901_find_a_peak_element_ii/readme.md @@ -14,7 +14,7 @@ You must write an algorithm that runs in `O(m log(n))` or `O(n log(m))` time. ![](https://assets.leetcode.com/uploads/2021/06/08/1.png) -**Input:** mat = [[1,4],[3,2]] +**Input:** mat = \[\[1,4],[3,2]] **Output:** [0,1] @@ -24,7 +24,7 @@ You must write an algorithm that runs in `O(m log(n))` or `O(n log(m))` time. **![](https://assets.leetcode.com/uploads/2021/06/07/3.png)** -**Input:** mat = [[10,20,15],[21,30,14],[7,16,32]] +**Input:** mat = \[\[10,20,15],[21,30,14],[7,16,32]] **Output:** [1,1] diff --git a/src/main/java/g1901_2000/s1905_count_sub_islands/readme.md b/src/main/java/g1901_2000/s1905_count_sub_islands/readme.md index 4e7b408d..cb8800a7 100644 --- a/src/main/java/g1901_2000/s1905_count_sub_islands/readme.md +++ b/src/main/java/g1901_2000/s1905_count_sub_islands/readme.md @@ -12,7 +12,7 @@ Return the _**number** of islands in_ `grid2` _that are considered **sub-islands ![](https://assets.leetcode.com/uploads/2021/06/10/test1.png) -**Input:** grid1 = [[1,1,1,0,0],[0,1,1,1,1],[0,0,0,0,0],[1,0,0,0,0],[1,1,0,1,1]], grid2 = [[1,1,1,0,0],[0,0,1,1,1],[0,1,0,0,0],[1,0,1,1,0],[0,1,0,1,0]] +**Input:** grid1 = \[\[1,1,1,0,0],[0,1,1,1,1],[0,0,0,0,0],[1,0,0,0,0],[1,1,0,1,1]], grid2 = \[\[1,1,1,0,0],[0,0,1,1,1],[0,1,0,0,0],[1,0,1,1,0],[0,1,0,1,0]] **Output:** 3 @@ -22,7 +22,7 @@ Return the _**number** of islands in_ `grid2` _that are considered **sub-islands ![](https://assets.leetcode.com/uploads/2021/06/03/testcasex2.png) -**Input:** grid1 = [[1,0,1,0,1],[1,1,1,1,1],[0,0,0,0,0],[1,1,1,1,1],[1,0,1,0,1]], grid2 = [[0,0,0,0,0],[1,1,1,1,1],[0,1,0,1,0],[0,1,0,1,0],[1,0,0,0,1]] +**Input:** grid1 = \[\[1,0,1,0,1],[1,1,1,1,1],[0,0,0,0,0],[1,1,1,1,1],[1,0,1,0,1]], grid2 = \[\[0,0,0,0,0],[1,1,1,1,1],[0,1,0,1,0],[0,1,0,1,0],[1,0,0,0,1]] **Output:** 2 diff --git a/src/main/java/g1901_2000/s1906_minimum_absolute_difference_queries/readme.md b/src/main/java/g1901_2000/s1906_minimum_absolute_difference_queries/readme.md index e36d67dd..788b7c26 100644 --- a/src/main/java/g1901_2000/s1906_minimum_absolute_difference_queries/readme.md +++ b/src/main/java/g1901_2000/s1906_minimum_absolute_difference_queries/readme.md @@ -19,7 +19,7 @@ The value of `|x|` is defined as: **Example 1:** -**Input:** nums = [1,3,4,8], queries = [[0,1],[1,2],[2,3],[0,3]] +**Input:** nums = [1,3,4,8], queries = \[\[0,1],[1,2],[2,3],[0,3]] **Output:** [2,1,4,1] @@ -35,7 +35,7 @@ The value of `|x|` is defined as: **Example 2:** -**Input:** nums = [4,5,2,2,7,10], queries = [[2,3],[0,2],[0,5],[3,5]] +**Input:** nums = [4,5,2,2,7,10], queries = \[\[2,3],[0,2],[0,5],[3,5]] **Output:** [-1,1,1,3] diff --git a/src/main/java/g1901_2000/s1914_cyclically_rotating_a_grid/readme.md b/src/main/java/g1901_2000/s1914_cyclically_rotating_a_grid/readme.md index cdf5044f..08f96799 100644 --- a/src/main/java/g1901_2000/s1914_cyclically_rotating_a_grid/readme.md +++ b/src/main/java/g1901_2000/s1914_cyclically_rotating_a_grid/readme.md @@ -18,7 +18,7 @@ Return _the matrix after applying_ `k` _cyclic rotations to it_. ![](https://assets.leetcode.com/uploads/2021/06/19/rod2.png) -**Input:** grid = [[40,10],[30,20]], k = 1 +**Input:** grid = \[\[40,10],[30,20]], k = 1 **Output:** [[10,20],[40,30]] @@ -28,7 +28,7 @@ Return _the matrix after applying_ `k` _cyclic rotations to it_. **![](https://assets.leetcode.com/uploads/2021/06/10/ringofgrid5.png)** **![](https://assets.leetcode.com/uploads/2021/06/10/ringofgrid6.png)** **![](https://assets.leetcode.com/uploads/2021/06/10/ringofgrid7.png)** -**Input:** grid = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], k = 2 +**Input:** grid = \[\[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]], k = 2 **Output:** [[3,4,8,12],[2,11,10,16],[1,7,6,15],[5,9,13,14]] diff --git a/src/main/java/g1901_2000/s1923_longest_common_subpath/readme.md b/src/main/java/g1901_2000/s1923_longest_common_subpath/readme.md index 50beccf3..d5ec9065 100644 --- a/src/main/java/g1901_2000/s1923_longest_common_subpath/readme.md +++ b/src/main/java/g1901_2000/s1923_longest_common_subpath/readme.md @@ -12,7 +12,7 @@ A **subpath** of a path is a contiguous sequence of cities within that path. **Example 1:** -**Input:** n = 5, paths = [[0,1,2,3,4], +**Input:** n = 5, paths = \[\[0,1,2,3,4], [2,3,4], [4,0,1,2,3]] @@ -22,7 +22,7 @@ A **subpath** of a path is a contiguous sequence of cities within that path. **Example 2:** -**Input:** n = 3, paths = [[0],[1],[2]] +**Input:** n = 3, paths = \[\[0],[1],[2]] **Output:** 0 @@ -30,7 +30,7 @@ A **subpath** of a path is a contiguous sequence of cities within that path. **Example 3:** -**Input:** n = 5, paths = [[0,1,2,3,4], +**Input:** n = 5, paths = \[\[0,1,2,3,4], [4,3,2,1,0]] **Output:** 1 diff --git a/src/main/java/g1901_2000/s1926_nearest_exit_from_entrance_in_maze/readme.md b/src/main/java/g1901_2000/s1926_nearest_exit_from_entrance_in_maze/readme.md index 0deb3e38..6c3be742 100644 --- a/src/main/java/g1901_2000/s1926_nearest_exit_from_entrance_in_maze/readme.md +++ b/src/main/java/g1901_2000/s1926_nearest_exit_from_entrance_in_maze/readme.md @@ -12,7 +12,7 @@ Return _the **number of steps** in the shortest path from the_ `entrance` _to th ![](https://assets.leetcode.com/uploads/2021/06/04/nearest1-grid.jpg) -**Input:** maze = [["+","+",".","+"],[".",".",".","+"],["+","+","+","."]], entrance = [1,2] +**Input:** maze = \[\["+","+",".","+"],[".",".",".","+"],["+","+","+","."]], entrance = [1,2] **Output:** 1 @@ -30,7 +30,7 @@ It is impossible to reach [2,3] from the entrance. Thus, the nearest exit is [0, ![](https://assets.leetcode.com/uploads/2021/06/04/nearesr2-grid.jpg) -**Input:** maze = [["+","+","+"],[".",".","."],["+","+","+"]], entrance = [1,0] +**Input:** maze = \[\["+","+","+"],[".",".","."],["+","+","+"]], entrance = [1,0] **Output:** 2 @@ -46,7 +46,7 @@ Thus, the nearest exit is [1,2], which is 2 steps away. ![](https://assets.leetcode.com/uploads/2021/06/04/nearest3-grid.jpg) -**Input:** maze = [[".","+"]], entrance = [0,0] +**Input:** maze = \[\[".","+"]], entrance = [0,0] **Output:** -1 diff --git a/src/main/java/g1901_2000/s1928_minimum_cost_to_reach_destination_in_time/readme.md b/src/main/java/g1901_2000/s1928_minimum_cost_to_reach_destination_in_time/readme.md index 292888fc..7dd2dd9b 100644 --- a/src/main/java/g1901_2000/s1928_minimum_cost_to_reach_destination_in_time/readme.md +++ b/src/main/java/g1901_2000/s1928_minimum_cost_to_reach_destination_in_time/readme.md @@ -14,7 +14,7 @@ Given `maxTime`, `edges`, and `passingFees`, return _the **minimum cost** to com ![](https://assets.leetcode.com/uploads/2021/06/04/leetgraph1-1.png) -**Input:** maxTime = 30, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3] +**Input:** maxTime = 30, edges = \[\[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3] **Output:** 11 @@ -24,7 +24,7 @@ Given `maxTime`, `edges`, and `passingFees`, return _the **minimum cost** to com **![](https://assets.leetcode.com/uploads/2021/06/04/copy-of-leetgraph1-1.png)** -**Input:** maxTime = 29, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3] +**Input:** maxTime = 29, edges = \[\[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3] **Output:** 48 @@ -32,7 +32,7 @@ Given `maxTime`, `edges`, and `passingFees`, return _the **minimum cost** to com **Example 3:** -**Input:** maxTime = 25, edges = [[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3] +**Input:** maxTime = 25, edges = \[\[0,1,10],[1,2,10],[2,5,10],[0,3,1],[3,4,10],[4,5,15]], passingFees = [5,1,2,20,20,3] **Output:** -1 diff --git a/src/main/java/g1901_2000/s1932_merge_bsts_to_create_single_bst/readme.md b/src/main/java/g1901_2000/s1932_merge_bsts_to_create_single_bst/readme.md index 23a53854..6b4bef59 100644 --- a/src/main/java/g1901_2000/s1932_merge_bsts_to_create_single_bst/readme.md +++ b/src/main/java/g1901_2000/s1932_merge_bsts_to_create_single_bst/readme.md @@ -21,27 +21,27 @@ A leaf is a node that has no children. ![](https://assets.leetcode.com/uploads/2021/06/08/d1.png) -**Input:** trees = [[2,1],[3,2,5],[5,4]] +**Input:** trees = \[\[2,1],[3,2,5],[5,4]] **Output:** [3,2,5,1,null,4] -**Explanation:** In the first operation, pick i=1 and j=0, and merge trees[0] into trees[1]. Delete trees[0], so trees = [[3,2,5,1],[5,4]]. ![](https://assets.leetcode.com/uploads/2021/06/24/diagram.png) In the second operation, pick i=0 and j=1, and merge trees[1] into trees[0]. Delete trees[1], so trees = [[3,2,5,1,null,4]]. ![](https://assets.leetcode.com/uploads/2021/06/24/diagram-2.png) The resulting tree, shown above, is a valid BST, so return its root. +**Explanation:** In the first operation, pick i=1 and j=0, and merge trees[0] into trees[1]. Delete trees[0], so trees = \[\[3,2,5,1],[5,4]]. ![](https://assets.leetcode.com/uploads/2021/06/24/diagram.png) In the second operation, pick i=0 and j=1, and merge trees[1] into trees[0]. Delete trees[1], so trees = \[\[3,2,5,1,null,4]]. ![](https://assets.leetcode.com/uploads/2021/06/24/diagram-2.png) The resulting tree, shown above, is a valid BST, so return its root. **Example 2:** ![](https://assets.leetcode.com/uploads/2021/06/08/d2.png) -**Input:** trees = [[5,3,8],[3,2,6]] +**Input:** trees = \[\[5,3,8],[3,2,6]] **Output:** [] -**Explanation:** Pick i=0 and j=1 and merge trees[1] into trees[0]. Delete trees[1], so trees = [[5,3,8,2,6]]. ![](https://assets.leetcode.com/uploads/2021/06/24/diagram-3.png) The resulting tree is shown above. This is the only valid operation that can be performed, but the resulting tree is not a valid BST, so return null. +**Explanation:** Pick i=0 and j=1 and merge trees[1] into trees[0]. Delete trees[1], so trees = \[\[5,3,8,2,6]]. ![](https://assets.leetcode.com/uploads/2021/06/24/diagram-3.png) The resulting tree is shown above. This is the only valid operation that can be performed, but the resulting tree is not a valid BST, so return null. **Example 3:** ![](https://assets.leetcode.com/uploads/2021/06/08/d3.png) -**Input:** trees = [[5,4],[3]] +**Input:** trees = \[\[5,4],[3]] **Output:** [] diff --git a/src/main/java/g1901_2000/s1937_maximum_number_of_points_with_cost/readme.md b/src/main/java/g1901_2000/s1937_maximum_number_of_points_with_cost/readme.md index 224832ea..6e3ad8f5 100644 --- a/src/main/java/g1901_2000/s1937_maximum_number_of_points_with_cost/readme.md +++ b/src/main/java/g1901_2000/s1937_maximum_number_of_points_with_cost/readme.md @@ -19,7 +19,7 @@ Return _the **maximum** number of points you can achieve_. ![](https://assets.leetcode.com/uploads/2021/07/12/screenshot-2021-07-12-at-13-40-26-diagram-drawio-diagrams-net.png) -**Input:** points = [[1,2,3],[1,5,1],[3,1,1]] +**Input:** points = \[\[1,2,3],[1,5,1],[3,1,1]] **Output:** 9 @@ -37,7 +37,7 @@ Your final score is 11 - 2 = 9. ![](https://assets.leetcode.com/uploads/2021/07/12/screenshot-2021-07-12-at-13-42-14-diagram-drawio-diagrams-net.png) -**Input:** points = [[1,5],[2,3],[4,2]] +**Input:** points = \[\[1,5],[2,3],[4,2]] **Output:** 11 diff --git a/src/main/java/g1901_2000/s1938_maximum_genetic_difference_query/readme.md b/src/main/java/g1901_2000/s1938_maximum_genetic_difference_query/readme.md index 89ca145b..514e6637 100644 --- a/src/main/java/g1901_2000/s1938_maximum_genetic_difference_query/readme.md +++ b/src/main/java/g1901_2000/s1938_maximum_genetic_difference_query/readme.md @@ -12,33 +12,33 @@ Return _an array_ `ans` _where_ `ans[i]` _is the answer to the_ ithpainting[j] = [leftj, rightj, mixj] describes a **half-closed segment** [leftj, rightj) with the mixed color **sum** of mixj. -* For example, the painting created with `segments = [[1,4,5],[1,7,7]]` can be described by `painting = [[1,4,12],[4,7,7]]` because: +* For example, the painting created with `segments = \[\[1,4,5],[1,7,7]]` can be described by `painting = \[\[1,4,12],[4,7,7]]` because: * `[1,4)` is colored `{5,7}` (with a sum of `12`) from both the first and second segments. * `[4,7)` is colored `{7}` from only the second segment. @@ -24,47 +24,47 @@ A **half-closed segment** `[a, b)` is the section of the number line between poi ![](https://assets.leetcode.com/uploads/2021/06/18/1.png) -**Input:** segments = [[1,4,5],[4,7,7],[1,7,9]] +**Input:** segments = \[\[1,4,5],[4,7,7],[1,7,9]] **Output:** [[1,4,14],[4,7,16]] **Explanation:** The painting can be described as follows: -- [1,4) is colored {5,9} (with a sum of 14) from the first and third segments. +- \[1,4) is colored {5,9} (with a sum of 14) from the first and third segments. -- [4,7) is colored {7,9} (with a sum of 16) from the second and third segments. +- \[4,7) is colored {7,9} (with a sum of 16) from the second and third segments. **Example 2:** ![](https://assets.leetcode.com/uploads/2021/06/18/2.png) -**Input:** segments = [[1,7,9],[6,8,15],[8,10,7]] +**Input:** segments = \[\[1,7,9],[6,8,15],[8,10,7]] **Output:** [[1,6,9],[6,7,24],[7,8,15],[8,10,7]] **Explanation:** The painting can be described as follows: -- [1,6) is colored 9 from the first segment. +- \[1,6) is colored 9 from the first segment. -- [6,7) is colored {9,15} (with a sum of 24) from the first and second segments. +- \[6,7) is colored {9,15} (with a sum of 24) from the first and second segments. -- [7,8) is colored 15 from the second segment. +- \[7,8) is colored 15 from the second segment. -- [8,10) is colored 7 from the third segment. +- \[8,10) is colored 7 from the third segment. **Example 3:** ![](https://assets.leetcode.com/uploads/2021/07/04/c1.png) -**Input:** segments = [[1,4,5],[1,4,7],[4,7,1],[4,7,11]] +**Input:** segments = \[\[1,4,5],[1,4,7],[4,7,1],[4,7,11]] **Output:** [[1,4,12],[4,7,12]] **Explanation:** The painting can be described as follows: -- [1,4) is colored {5,7} (with a sum of 12) from the first and second segments. +- \[1,4) is colored {5,7} (with a sum of 12) from the first and second segments. -- [4,7) is colored {1,11} (with a sum of 12) from the third and fourth segments. +- \[4,7) is colored {1,11} (with a sum of 12) from the third and fourth segments. Note that returning a single segment [1,7) is incorrect because the mixed color sets are different. diff --git a/src/main/java/g1901_2000/s1947_maximum_compatibility_score_sum/readme.md b/src/main/java/g1901_2000/s1947_maximum_compatibility_score_sum/readme.md index 30eaf8b1..25ae1691 100644 --- a/src/main/java/g1901_2000/s1947_maximum_compatibility_score_sum/readme.md +++ b/src/main/java/g1901_2000/s1947_maximum_compatibility_score_sum/readme.md @@ -16,7 +16,7 @@ Given `students` and `mentors`, return _the **maximum compatibility score sum** **Example 1:** -**Input:** students = [[1,1,0],[1,0,1],[0,0,1]], mentors = [[1,0,0],[0,0,1],[1,1,0]] +**Input:** students = \[\[1,1,0],[1,0,1],[0,0,1]], mentors = \[\[1,0,0],[0,0,1],[1,1,0]] **Output:** 8 @@ -32,7 +32,7 @@ The compatibility score sum is 3 + 2 + 3 = 8. **Example 2:** -**Input:** students = [[0,0],[0,0],[0,0]], mentors = [[1,1],[1,1],[1,1]] +**Input:** students = \[\[0,0],[0,0],[0,0]], mentors = \[\[1,1],[1,1],[1,1]] **Output:** 0 diff --git a/src/main/java/g1901_2000/s1948_delete_duplicate_folders_in_system/readme.md b/src/main/java/g1901_2000/s1948_delete_duplicate_folders_in_system/readme.md index 8fc5fc90..b3fa47de 100644 --- a/src/main/java/g1901_2000/s1948_delete_duplicate_folders_in_system/readme.md +++ b/src/main/java/g1901_2000/s1948_delete_duplicate_folders_in_system/readme.md @@ -27,7 +27,7 @@ Return _the 2D array_ `ans` _containing the paths of the **remaining** folders a ![](https://assets.leetcode.com/uploads/2021/07/19/lc-dupfolder1.jpg) -**Input:** paths = [["a"],["c"],["d"],["a","b"],["c","b"],["d","a"]] +**Input:** paths = \[\["a"],["c"],["d"],["a","b"],["c","b"],["d","a"]] **Output:** [["d"],["d","a"]] @@ -37,7 +37,7 @@ Return _the 2D array_ `ans` _containing the paths of the **remaining** folders a ![](https://assets.leetcode.com/uploads/2021/07/19/lc-dupfolder2.jpg) -**Input:** paths = [["a"],["c"],["a","b"],["c","b"],["a","b","x"],["a","b","x","y"],["w"],["w","y"]] +**Input:** paths = \[\["a"],["c"],["a","b"],["c","b"],["a","b","x"],["a","b","x","y"],["w"],["w","y"]] **Output:** [["c"],["c","b"],["a"],["a","b"]] @@ -47,7 +47,7 @@ Return _the 2D array_ `ans` _containing the paths of the **remaining** folders a ![](https://assets.leetcode.com/uploads/2021/07/19/lc-dupfolder3.jpg) -**Input:** paths = [["a","b"],["c","d"],["c"],["a"]] +**Input:** paths = \[\["a","b"],["c","d"],["c"],["a"]] **Output:** [["c"],["c","d"],["a"],["a","b"]] diff --git a/src/main/java/g1901_2000/s1955_count_number_of_special_subsequences/readme.md b/src/main/java/g1901_2000/s1955_count_number_of_special_subsequences/readme.md index 24ecbfdd..3449db4e 100644 --- a/src/main/java/g1901_2000/s1955_count_number_of_special_subsequences/readme.md +++ b/src/main/java/g1901_2000/s1955_count_number_of_special_subsequences/readme.md @@ -35,19 +35,19 @@ A **subsequence** of an array is a sequence that can be derived from the array b **Explanation:** The special subsequences are bolded: -- [**0**,**1**,**2**,0,1,2] +- \[**0**,**1**,**2**,0,1,2] -- [**0**,**1**,2,0,1,**2**] +- \[**0**,**1**,2,0,1,**2**] -- [**0**,**1**,**2**,0,1,**2**] +- \[**0**,**1**,**2**,0,1,**2**] -- [**0**,**1**,2,0,**1**,**2**] +- \[**0**,**1**,2,0,**1**,**2**] -- [**0**,1,2,**0**,**1**,**2**] +- \[**0**,1,2,**0**,**1**,**2**] -- [**0**,1,2,0,**1**,**2**] +- \[**0**,1,2,0,**1**,**2**] -- [0,1,2,**0**,**1**,**2**] +- \[0,1,2,**0**,**1**,**2**] **Constraints:** diff --git a/src/main/java/g1901_2000/s1958_check_if_move_is_legal/readme.md b/src/main/java/g1901_2000/s1958_check_if_move_is_legal/readme.md index 239269fc..9fabb410 100644 --- a/src/main/java/g1901_2000/s1958_check_if_move_is_legal/readme.md +++ b/src/main/java/g1901_2000/s1958_check_if_move_is_legal/readme.md @@ -18,7 +18,7 @@ Given two integers `rMove` and `cMove` and a character `color` representing the **Input:** - board = [[".",".",".","B",".",".",".","."], + board = [ [".",".",".","B",".",".",".","."], [".",".",".","W",".",".",".","."], [".",".",".","W",".",".",".","."], [".",".",".","W",".",".",".","."], @@ -38,7 +38,7 @@ Given two integers `rMove` and `cMove` and a character `color` representing the **Input:** - board = [[".",".",".",".",".",".",".","."], + board = [ [".",".",".",".",".",".",".","."], [".","B",".",".","W",".",".","."], [".",".","W",".",".",".",".","."], [".",".",".","W","B",".",".","."], diff --git a/src/main/java/g1901_2000/s1970_last_day_where_you_can_still_cross/readme.md b/src/main/java/g1901_2000/s1970_last_day_where_you_can_still_cross/readme.md index bb1346e2..177288e0 100644 --- a/src/main/java/g1901_2000/s1970_last_day_where_you_can_still_cross/readme.md +++ b/src/main/java/g1901_2000/s1970_last_day_where_you_can_still_cross/readme.md @@ -14,7 +14,7 @@ Return _the **last** day where it is possible to walk from the **top** to the ** ![](https://assets.leetcode.com/uploads/2021/07/27/1.png) -**Input:** row = 2, col = 2, cells = [[1,1],[2,1],[1,2],[2,2]] +**Input:** row = 2, col = 2, cells = \[\[1,1],[2,1],[1,2],[2,2]] **Output:** 2 @@ -24,7 +24,7 @@ Return _the **last** day where it is possible to walk from the **top** to the ** ![](https://assets.leetcode.com/uploads/2021/07/27/2.png) -**Input:** row = 2, col = 2, cells = [[1,1],[1,2],[2,1],[2,2]] +**Input:** row = 2, col = 2, cells = \[\[1,1],[1,2],[2,1],[2,2]] **Output:** 1 @@ -34,7 +34,7 @@ Return _the **last** day where it is possible to walk from the **top** to the ** ![](https://assets.leetcode.com/uploads/2021/07/27/3.png) -**Input:** row = 3, col = 3, cells = [[1,2],[2,1],[3,3],[2,2],[1,1],[1,3],[2,3],[3,2],[3,1]] +**Input:** row = 3, col = 3, cells = \[\[1,2],[2,1],[3,3],[2,2],[1,1],[1,3],[2,3],[3,2],[3,1]] **Output:** 3 diff --git a/src/main/java/g1901_2000/s1971_find_if_path_exists_in_graph/readme.md b/src/main/java/g1901_2000/s1971_find_if_path_exists_in_graph/readme.md index 7ebc1cbe..b6d912e3 100644 --- a/src/main/java/g1901_2000/s1971_find_if_path_exists_in_graph/readme.md +++ b/src/main/java/g1901_2000/s1971_find_if_path_exists_in_graph/readme.md @@ -12,7 +12,7 @@ Given `edges` and the integers `n`, `source`, and `destination`, return `true` _ ![](https://assets.leetcode.com/uploads/2021/08/14/validpath-ex1.png) -**Input:** n = 3, edges = [[0,1],[1,2],[2,0]], source = 0, destination = 2 +**Input:** n = 3, edges = \[\[0,1],[1,2],[2,0]], source = 0, destination = 2 **Output:** true @@ -22,7 +22,7 @@ Given `edges` and the integers `n`, `source`, and `destination`, return `true` _ ![](https://assets.leetcode.com/uploads/2021/08/14/validpath-ex2.png) -**Input:** n = 6, edges = [[0,1],[0,2],[3,5],[5,4],[4,3]], source = 0, destination = 5 +**Input:** n = 6, edges = \[\[0,1],[0,2],[3,5],[5,4],[4,3]], source = 0, destination = 5 **Output:** false diff --git a/src/main/java/g1901_2000/s1975_maximum_matrix_sum/readme.md b/src/main/java/g1901_2000/s1975_maximum_matrix_sum/readme.md index 8f8d71e5..97968f43 100644 --- a/src/main/java/g1901_2000/s1975_maximum_matrix_sum/readme.md +++ b/src/main/java/g1901_2000/s1975_maximum_matrix_sum/readme.md @@ -14,7 +14,7 @@ Your goal is to **maximize** the summation of the matrix's elements. Return _the ![](https://assets.leetcode.com/uploads/2021/07/16/pc79-q2ex1.png) -**Input:** matrix = [[1,-1],[-1,1]] +**Input:** matrix = \[\[1,-1],[-1,1]] **Output:** 4 @@ -28,7 +28,7 @@ Your goal is to **maximize** the summation of the matrix's elements. Return _the ![](https://assets.leetcode.com/uploads/2021/07/16/pc79-q2ex2.png) -**Input:** matrix = [[1,2,3],[-1,-2,-3],[1,2,3]] +**Input:** matrix = \[\[1,2,3],[-1,-2,-3],[1,2,3]] **Output:** 16 diff --git a/src/main/java/g1901_2000/s1976_number_of_ways_to_arrive_at_destination/readme.md b/src/main/java/g1901_2000/s1976_number_of_ways_to_arrive_at_destination/readme.md index bc0a1e30..4ddc85a8 100644 --- a/src/main/java/g1901_2000/s1976_number_of_ways_to_arrive_at_destination/readme.md +++ b/src/main/java/g1901_2000/s1976_number_of_ways_to_arrive_at_destination/readme.md @@ -12,7 +12,7 @@ Return _the **number of ways** you can arrive at your destination in the **short ![](https://assets.leetcode.com/uploads/2021/07/17/graph2.png) -**Input:** n = 7, roads = [[0,6,7],[0,1,2],[1,2,3],[1,3,3],[6,3,3],[3,5,1],[6,5,1],[2,5,1],[0,4,5],[4,6,2]] +**Input:** n = 7, roads = \[\[0,6,7],[0,1,2],[1,2,3],[1,3,3],[6,3,3],[3,5,1],[6,5,1],[2,5,1],[0,4,5],[4,6,2]] **Output:** 4 @@ -28,7 +28,7 @@ Return _the **number of ways** you can arrive at your destination in the **short **Example 2:** -**Input:** n = 2, roads = [[1,0,10]] +**Input:** n = 2, roads = \[\[1,0,10]] **Output:** 1 diff --git a/src/main/java/g1901_2000/s1981_minimize_the_difference_between_target_and_chosen_elements/readme.md b/src/main/java/g1901_2000/s1981_minimize_the_difference_between_target_and_chosen_elements/readme.md index b5926034..d54b8714 100644 --- a/src/main/java/g1901_2000/s1981_minimize_the_difference_between_target_and_chosen_elements/readme.md +++ b/src/main/java/g1901_2000/s1981_minimize_the_difference_between_target_and_chosen_elements/readme.md @@ -14,7 +14,7 @@ The **absolute difference** between two numbers `a` and `b` is the absolute valu ![](https://assets.leetcode.com/uploads/2021/08/03/matrix1.png) -**Input:** mat = [[1,2,3],[4,5,6],[7,8,9]], target = 13 +**Input:** mat = \[\[1,2,3],[4,5,6],[7,8,9]], target = 13 **Output:** 0 @@ -32,7 +32,7 @@ The sum of the chosen elements is 13, which equals the target, so the absolute d ![](https://assets.leetcode.com/uploads/2021/08/03/matrix1-1.png) -**Input:** mat = [[1],[2],[3]], target = 100 +**Input:** mat = \[\[1],[2],[3]], target = 100 **Output:** 94 @@ -50,7 +50,7 @@ The sum of the chosen elements is 6, and the absolute difference is 94. ![](https://assets.leetcode.com/uploads/2021/08/03/matrix1-3.png) -**Input:** mat = [[1,2,9,8,7]], target = 6 +**Input:** mat = \[\[1,2,9,8,7]], target = 6 **Output:** 1 diff --git a/src/main/java/g1901_2000/s1982_find_array_given_subset_sums/readme.md b/src/main/java/g1901_2000/s1982_find_array_given_subset_sums/readme.md index b34a1f22..79389f70 100644 --- a/src/main/java/g1901_2000/s1982_find_array_given_subset_sums/readme.md +++ b/src/main/java/g1901_2000/s1982_find_array_given_subset_sums/readme.md @@ -18,21 +18,21 @@ An array `sub` is a **subset** of an array `arr` if `sub` can be obtained from ` **Explanation:** [1,2,-3] is able to achieve the given subset sums: -- []: sum is 0 +- \[]: sum is 0 -- [1]: sum is 1 +- \[1]: sum is 1 -- [2]: sum is 2 +- \[2]: sum is 2 -- [1,2]: sum is 3 +- \[1,2]: sum is 3 -- [-3]: sum is -3 +- \[-3]: sum is -3 -- [1,-3]: sum is -2 +- \[1,-3]: sum is -2 -- [2,-3]: sum is -1 +- \[2,-3]: sum is -1 -- [1,2,-3]: sum is 0 +- \[1,2,-3]: sum is 0 Note that any permutation of [1,2,-3] and also any permutation of [-1,-2,3] will also be accepted. diff --git a/src/main/java/g1901_2000/s1984_minimum_difference_between_highest_and_lowest_of_k_scores/readme.md b/src/main/java/g1901_2000/s1984_minimum_difference_between_highest_and_lowest_of_k_scores/readme.md index 2ba2d35b..8291daae 100644 --- a/src/main/java/g1901_2000/s1984_minimum_difference_between_highest_and_lowest_of_k_scores/readme.md +++ b/src/main/java/g1901_2000/s1984_minimum_difference_between_highest_and_lowest_of_k_scores/readme.md @@ -16,7 +16,7 @@ Return _the **minimum** possible difference_. **Explanation:** There is one way to pick score(s) of one student: -- [**90**]. The difference between the highest and lowest score is 90 - 90 = 0. +- \[**90**]. The difference between the highest and lowest score is 90 - 90 = 0. The minimum possible difference is 0. @@ -28,17 +28,17 @@ The minimum possible difference is 0. **Explanation:** There are six ways to pick score(s) of two students: -- [**9**,**4**,1,7]. The difference between the highest and lowest score is 9 - 4 = 5. +- \[**9**,**4**,1,7]. The difference between the highest and lowest score is 9 - 4 = 5. -- [**9**,4,**1**,7]. The difference between the highest and lowest score is 9 - 1 = 8. +- \[**9**,4,**1**,7]. The difference between the highest and lowest score is 9 - 1 = 8. -- [**9**,4,1,**7**]. The difference between the highest and lowest score is 9 - 7 = 2. +- \[**9**,4,1,**7**]. The difference between the highest and lowest score is 9 - 7 = 2. -- [9,**4**,**1**,7]. The difference between the highest and lowest score is 4 - 1 = 3. +- \[9,**4**,**1**,7]. The difference between the highest and lowest score is 4 - 1 = 3. -- [9,**4**,1,**7**]. The difference between the highest and lowest score is 7 - 4 = 3. +- \[9,**4**,1,**7**]. The difference between the highest and lowest score is 7 - 4 = 3. -- [9,4,**1**,**7**]. The difference between the highest and lowest score is 7 - 1 = 6. +- \[9,4,**1**,**7**]. The difference between the highest and lowest score is 7 - 1 = 6. The minimum possible difference is 2. diff --git a/src/main/java/g1901_2000/s1992_find_all_groups_of_farmland/readme.md b/src/main/java/g1901_2000/s1992_find_all_groups_of_farmland/readme.md index 429d66b2..21aa4981 100644 --- a/src/main/java/g1901_2000/s1992_find_all_groups_of_farmland/readme.md +++ b/src/main/java/g1901_2000/s1992_find_all_groups_of_farmland/readme.md @@ -14,7 +14,7 @@ Return _a 2D array containing the 4-length arrays described above for each **gro ![](https://assets.leetcode.com/uploads/2021/07/27/screenshot-2021-07-27-at-12-23-15-copy-of-diagram-drawio-diagrams-net.png) -**Input:** land = [[1,0,0],[0,1,1],[0,1,1]] +**Input:** land = \[\[1,0,0],[0,1,1],[0,1,1]] **Output:** [[0,0,0,0],[1,1,2,2]] @@ -28,7 +28,7 @@ The second group has a top left corner at land[1][1] and a bottom right corner a ![](https://assets.leetcode.com/uploads/2021/07/27/screenshot-2021-07-27-at-12-30-26-copy-of-diagram-drawio-diagrams-net.png) -**Input:** land = [[1,1],[1,1]] +**Input:** land = \[\[1,1],[1,1]] **Output:** [[0,0,1,1]] @@ -40,7 +40,7 @@ The first group has a top left corner at land[0][0] and a bottom right corner at ![](https://assets.leetcode.com/uploads/2021/07/27/screenshot-2021-07-27-at-12-32-24-copy-of-diagram-drawio-diagrams-net.png) -**Input:** land = [[0]] +**Input:** land = \[\[0]] **Output:** [] diff --git a/src/main/java/g1901_2000/s1994_the_number_of_good_subsets/readme.md b/src/main/java/g1901_2000/s1994_the_number_of_good_subsets/readme.md index 159bd7c7..5b3a6031 100644 --- a/src/main/java/g1901_2000/s1994_the_number_of_good_subsets/readme.md +++ b/src/main/java/g1901_2000/s1994_the_number_of_good_subsets/readme.md @@ -20,17 +20,17 @@ A **subset** of `nums` is any array that can be obtained by deleting some (possi **Explanation:** The good subsets are: -- [1,2]: product is 2, which is the product of distinct prime 2. +- \[1,2]: product is 2, which is the product of distinct prime 2. -- [1,2,3]: product is 6, which is the product of distinct primes 2 and 3. +- \[1,2,3]: product is 6, which is the product of distinct primes 2 and 3. -- [1,3]: product is 3, which is the product of distinct prime 3. +- \[1,3]: product is 3, which is the product of distinct prime 3. -- [2]: product is 2, which is the product of distinct prime 2. +- \[2]: product is 2, which is the product of distinct prime 2. -- [2,3]: product is 6, which is the product of distinct primes 2 and 3. +- \[2,3]: product is 6, which is the product of distinct primes 2 and 3. -- [3]: product is 3, which is the product of distinct prime 3. +- \[3]: product is 3, which is the product of distinct prime 3. **Example 2:** @@ -40,15 +40,15 @@ A **subset** of `nums` is any array that can be obtained by deleting some (possi **Explanation:** The good subsets are: -- [2]: product is 2, which is the product of distinct prime 2. +- \[2]: product is 2, which is the product of distinct prime 2. -- [2,3]: product is 6, which is the product of distinct primes 2 and 3. +- \[2,3]: product is 6, which is the product of distinct primes 2 and 3. -- [2,15]: product is 30, which is the product of distinct primes 2, 3, and 5. +- \[2,15]: product is 30, which is the product of distinct primes 2, 3, and 5. -- [3]: product is 3, which is the product of distinct prime 3. +- \[3]: product is 3, which is the product of distinct prime 3. -- [15]: product is 15, which is the product of distinct primes 3 and 5. +- \[15]: product is 15, which is the product of distinct primes 3 and 5. **Constraints:** diff --git a/src/main/java/g1901_2000/s1996_the_number_of_weak_characters_in_the_game/readme.md b/src/main/java/g1901_2000/s1996_the_number_of_weak_characters_in_the_game/readme.md index e39381a9..0be45120 100644 --- a/src/main/java/g1901_2000/s1996_the_number_of_weak_characters_in_the_game/readme.md +++ b/src/main/java/g1901_2000/s1996_the_number_of_weak_characters_in_the_game/readme.md @@ -10,7 +10,7 @@ Return _the number of **weak** characters_. **Example 1:** -**Input:** properties = [[5,5],[6,3],[3,6]] +**Input:** properties = \[\[5,5],[6,3],[3,6]] **Output:** 0 @@ -18,7 +18,7 @@ Return _the number of **weak** characters_. **Example 2:** -**Input:** properties = [[2,2],[3,3]] +**Input:** properties = \[\[2,2],[3,3]] **Output:** 1 @@ -26,7 +26,7 @@ Return _the number of **weak** characters_. **Example 3:** -**Input:** properties = [[1,5],[10,4],[4,3]] +**Input:** properties = \[\[1,5],[10,4],[4,3]] **Output:** 1 diff --git a/src/main/java/g2001_2100/s2001_number_of_pairs_of_interchangeable_rectangles/readme.md b/src/main/java/g2001_2100/s2001_number_of_pairs_of_interchangeable_rectangles/readme.md index 1552d500..4da95b25 100644 --- a/src/main/java/g2001_2100/s2001_number_of_pairs_of_interchangeable_rectangles/readme.md +++ b/src/main/java/g2001_2100/s2001_number_of_pairs_of_interchangeable_rectangles/readme.md @@ -10,7 +10,7 @@ Return _the **number** of pairs of **interchangeable** rectangles in_ `rectangle **Example 1:** -**Input:** rectangles = [[4,8],[3,6],[10,20],[15,30]] +**Input:** rectangles = \[\[4,8],[3,6],[10,20],[15,30]] **Output:** 6 @@ -30,7 +30,7 @@ Return _the **number** of pairs of **interchangeable** rectangles in_ `rectangle **Example 2:** -**Input:** rectangles = [[4,5],[7,8]] +**Input:** rectangles = \[\[4,5],[7,8]] **Output:** 0 diff --git a/src/main/java/g2001_2100/s2006_count_number_of_pairs_with_absolute_difference_k/readme.md b/src/main/java/g2001_2100/s2006_count_number_of_pairs_with_absolute_difference_k/readme.md index 61f51b4d..6928b45a 100644 --- a/src/main/java/g2001_2100/s2006_count_number_of_pairs_with_absolute_difference_k/readme.md +++ b/src/main/java/g2001_2100/s2006_count_number_of_pairs_with_absolute_difference_k/readme.md @@ -17,13 +17,13 @@ The value of `|x|` is defined as: **Explanation:** The pairs with an absolute difference of 1 are: -- [**1**,**2**,2,1] +- \[**1**,**2**,2,1] -- [**1**,2,**2**,1] +- \[**1**,2,**2**,1] -- [1,**2**,2,**1**] +- \[1,**2**,2,**1**] -- [1,2,**2**,**1**] +- \[1,2,**2**,**1**] **Example 2:** @@ -41,11 +41,11 @@ The value of `|x|` is defined as: **Explanation:** The pairs with an absolute difference of 2 are: -- [**3**,2,**1**,5,4] +- \[**3**,2,**1**,5,4] -- [**3**,2,1,**5**,4] +- \[**3**,2,1,**5**,4] -- [3,**2**,1,5,**4**] +- \[3,**2**,1,5,**4**] **Constraints:** diff --git a/src/main/java/g2001_2100/s2008_maximum_earnings_from_taxi/readme.md b/src/main/java/g2001_2100/s2008_maximum_earnings_from_taxi/readme.md index b2045138..77fa5aa5 100644 --- a/src/main/java/g2001_2100/s2008_maximum_earnings_from_taxi/readme.md +++ b/src/main/java/g2001_2100/s2008_maximum_earnings_from_taxi/readme.md @@ -14,7 +14,7 @@ Given `n` and `rides`, return _the **maximum** number of dollars you can earn by **Example 1:** -**Input:** n = 5, rides = [[2,5,4],[1,5,1]] +**Input:** n = 5, rides = \[\[2,5,4],[1,5,1]] **Output:** 7 @@ -22,7 +22,7 @@ Given `n` and `rides`, return _the **maximum** number of dollars you can earn by **Example 2:** -**Input:** n = 20, rides = [[1,6,1],[3,10,2],[10,12,3],[11,12,2],[12,15,2],[13,18,1]] +**Input:** n = 20, rides = \[\[1,6,1],[3,10,2],[10,12,3],[11,12,2],[12,15,2],[13,18,1]] **Output:** 20 diff --git a/src/main/java/g2001_2100/s2017_grid_game/readme.md b/src/main/java/g2001_2100/s2017_grid_game/readme.md index df8581bf..4fe2dc48 100644 --- a/src/main/java/g2001_2100/s2017_grid_game/readme.md +++ b/src/main/java/g2001_2100/s2017_grid_game/readme.md @@ -14,7 +14,7 @@ The **first** robot wants to **minimize** the number of points collected by the ![](https://assets.leetcode.com/uploads/2021/09/08/a1.png) -**Input:** grid = [[2,5,4],[1,5,1]] +**Input:** grid = \[\[2,5,4],[1,5,1]] **Output:** 4 @@ -28,7 +28,7 @@ The second robot will collect 0 + 0 + 4 + 0 = 4 points. ![](https://assets.leetcode.com/uploads/2021/09/08/a2.png) -**Input:** grid = [[3,3,1],[8,5,2]] +**Input:** grid = \[\[3,3,1],[8,5,2]] **Output:** 4 @@ -42,7 +42,7 @@ The second robot will collect 0 + 3 + 1 + 0 = 4 points. ![](https://assets.leetcode.com/uploads/2021/09/08/a3.png) -**Input:** grid = [[1,3,1,15],[1,3,3,1]] +**Input:** grid = \[\[1,3,1,15],[1,3,3,1]] **Output:** 7 diff --git a/src/main/java/g2001_2100/s2018_check_if_word_can_be_placed_in_crossword/readme.md b/src/main/java/g2001_2100/s2018_check_if_word_can_be_placed_in_crossword/readme.md index 28af40b7..1b79ab19 100644 --- a/src/main/java/g2001_2100/s2018_check_if_word_can_be_placed_in_crossword/readme.md +++ b/src/main/java/g2001_2100/s2018_check_if_word_can_be_placed_in_crossword/readme.md @@ -17,7 +17,7 @@ Given a string `word`, return `true` _if_ `word` _can be placed in_ `board`_, or ![](https://assets.leetcode.com/uploads/2021/10/04/crossword-ex1-1.png) -**Input:** board = [["#", " ", "#"], [" ", " ", "#"], ["#", "c", " "]], word = "abc" +**Input:** board = \[\["#", " ", "#"], [" ", " ", "#"], ["#", "c", " "]], word = "abc" **Output:** true @@ -27,7 +27,7 @@ Given a string `word`, return `true` _if_ `word` _can be placed in_ `board`_, or ![](https://assets.leetcode.com/uploads/2021/10/04/crossword-ex2-1.png) -**Input:** board = [[" ", "#", "a"], [" ", "#", "c"], [" ", "#", "a"]], word = "ac" +**Input:** board = \[\[" ", "#", "a"], [" ", "#", "c"], [" ", "#", "a"]], word = "ac" **Output:** false @@ -37,7 +37,7 @@ Given a string `word`, return `true` _if_ `word` _can be placed in_ `board`_, or ![](https://assets.leetcode.com/uploads/2021/10/04/crossword-ex3-1.png) -**Input:** board = [["#", " ", "#"], [" ", " ", "#"], ["#", " ", "c"]], word = "ca" +**Input:** board = \[\["#", " ", "#"], [" ", " ", "#"], ["#", " ", "c"]], word = "ca" **Output:** true diff --git a/src/main/java/g2001_2100/s2033_minimum_operations_to_make_a_uni_value_grid/readme.md b/src/main/java/g2001_2100/s2033_minimum_operations_to_make_a_uni_value_grid/readme.md index 3546e737..c5356b44 100644 --- a/src/main/java/g2001_2100/s2033_minimum_operations_to_make_a_uni_value_grid/readme.md +++ b/src/main/java/g2001_2100/s2033_minimum_operations_to_make_a_uni_value_grid/readme.md @@ -12,7 +12,7 @@ Return _the **minimum** number of operations to make the grid **uni-value**_. If ![](https://assets.leetcode.com/uploads/2021/09/21/gridtxt.png) -**Input:** grid = [[2,4],[6,8]], x = 2 +**Input:** grid = \[\[2,4],[6,8]], x = 2 **Output:** 4 @@ -30,7 +30,7 @@ A total of 4 operations were used. ![](https://assets.leetcode.com/uploads/2021/09/21/gridtxt-1.png) -**Input:** grid = [[1,5],[2,3]], x = 1 +**Input:** grid = \[\[1,5],[2,3]], x = 1 **Output:** 5 @@ -40,7 +40,7 @@ A total of 4 operations were used. ![](https://assets.leetcode.com/uploads/2021/09/21/gridtxt-2.png) -**Input:** grid = [[1,2],[3,4]], x = 2 +**Input:** grid = \[\[1,2],[3,4]], x = 2 **Output:** -1 diff --git a/src/main/java/g2001_2100/s2039_the_time_when_the_network_becomes_idle/readme.md b/src/main/java/g2001_2100/s2039_the_time_when_the_network_becomes_idle/readme.md index 9f29e194..5d860d92 100644 --- a/src/main/java/g2001_2100/s2039_the_time_when_the_network_becomes_idle/readme.md +++ b/src/main/java/g2001_2100/s2039_the_time_when_the_network_becomes_idle/readme.md @@ -21,7 +21,7 @@ Return _the **earliest second** starting from which the network becomes **idle** ![example 1](https://assets.leetcode.com/uploads/2021/09/22/quiet-place-example1.png) -**Input:** edges = [[0,1],[1,2]], patience = [0,2,1] +**Input:** edges = \[\[0,1],[1,2]], patience = [0,2,1] **Output:** 8 @@ -70,7 +70,7 @@ This is the time when the network becomes idle. ![example 2](https://assets.leetcode.com/uploads/2021/09/04/network_a_quiet_place_2.png) -**Input:** edges = [[0,1],[0,2],[1,2]], patience = [0,10,10] +**Input:** edges = \[\[0,1],[0,2],[1,2]], patience = [0,10,10] **Output:** 3 diff --git a/src/main/java/g2001_2100/s2044_count_number_of_maximum_bitwise_or_subsets/readme.md b/src/main/java/g2001_2100/s2044_count_number_of_maximum_bitwise_or_subsets/readme.md index 03bc4e0d..6868f7bd 100644 --- a/src/main/java/g2001_2100/s2044_count_number_of_maximum_bitwise_or_subsets/readme.md +++ b/src/main/java/g2001_2100/s2044_count_number_of_maximum_bitwise_or_subsets/readme.md @@ -16,9 +16,9 @@ The bitwise OR of an array `a` is equal to `a[0] **OR** a[1] **OR** ... **OR** a **Explanation:** The maximum possible bitwise OR of a subset is 3. There are 2 subsets with a bitwise OR of 3: -- [3] +- \[3] -- [3,1] +- \[3,1] **Example 2:** @@ -36,17 +36,17 @@ The bitwise OR of an array `a` is equal to `a[0] **OR** a[1] **OR** ... **OR** a **Explanation:** The maximum possible bitwise OR of a subset is 7. There are 6 subsets with a bitwise OR of 7: -- [3,5] +- \[3,5] -- [3,1,5] +- \[3,1,5] -- [3,2,5] +- \[3,2,5] -- [3,2,1,5] +- \[3,2,1,5] -- [2,5] +- \[2,5] -- [2,1,5] +- \[2,1,5] **Constraints:** diff --git a/src/main/java/g2001_2100/s2045_second_minimum_time_to_reach_destination/readme.md b/src/main/java/g2001_2100/s2045_second_minimum_time_to_reach_destination/readme.md index 99e8be7e..cf46526d 100644 --- a/src/main/java/g2001_2100/s2045_second_minimum_time_to_reach_destination/readme.md +++ b/src/main/java/g2001_2100/s2045_second_minimum_time_to_reach_destination/readme.md @@ -21,7 +21,7 @@ Given `n`, `edges`, `time`, and `change`, return _the **second minimum time** it ![](https://assets.leetcode.com/uploads/2021/09/29/e1.png)         ![](https://assets.leetcode.com/uploads/2021/09/29/e2.png) -**Input:** n = 5, edges = [[1,2],[1,3],[1,4],[3,4],[4,5]], time = 3, change = 5 +**Input:** n = 5, edges = \[\[1,2],[1,3],[1,4],[3,4],[4,5]], time = 3, change = 5 **Output:** 13 @@ -59,7 +59,7 @@ Hence the second minimum time is 13 minutes. ![](https://assets.leetcode.com/uploads/2021/09/29/eg2.png) -**Input:** n = 2, edges = [[1,2]], time = 3, change = 2 +**Input:** n = 2, edges = \[\[1,2]], time = 3, change = 2 **Output:** 11 diff --git a/src/main/java/g2001_2100/s2050_parallel_courses_iii/readme.md b/src/main/java/g2001_2100/s2050_parallel_courses_iii/readme.md index 593f9efd..f11f4254 100644 --- a/src/main/java/g2001_2100/s2050_parallel_courses_iii/readme.md +++ b/src/main/java/g2001_2100/s2050_parallel_courses_iii/readme.md @@ -17,7 +17,7 @@ Return _the **minimum** number of months needed to complete all the courses_. **![](https://assets.leetcode.com/uploads/2021/10/07/ex1.png)** -**Input:** n = 3, relations = [[1,3],[2,3]], time = [3,2,5] +**Input:** n = 3, relations = \[\[1,3],[2,3]], time = [3,2,5] **Output:** 8 @@ -35,7 +35,7 @@ Thus, the earliest time we can start course 3 is at month 3, and the total time **![](https://assets.leetcode.com/uploads/2021/10/07/ex2.png)** -**Input:** n = 5, relations = [[1,5],[2,5],[3,5],[3,4],[4,5]], time = [1,2,3,4,5] +**Input:** n = 5, relations = \[\[1,5],[2,5],[3,5],[3,4],[4,5]], time = [1,2,3,4,5] **Output:** 12 diff --git a/src/main/java/g2001_2100/s2054_two_best_non_overlapping_events/readme.md b/src/main/java/g2001_2100/s2054_two_best_non_overlapping_events/readme.md index 383bd7c8..79f5e337 100644 --- a/src/main/java/g2001_2100/s2054_two_best_non_overlapping_events/readme.md +++ b/src/main/java/g2001_2100/s2054_two_best_non_overlapping_events/readme.md @@ -12,7 +12,7 @@ Note that the start time and end time is **inclusive**: that is, you cannot atte ![](https://assets.leetcode.com/uploads/2021/09/21/picture5.png) -**Input:** events = [[1,3,2],[4,5,2],[2,4,3]] +**Input:** events = \[\[1,3,2],[4,5,2],[2,4,3]] **Output:** 4 @@ -22,7 +22,7 @@ Note that the start time and end time is **inclusive**: that is, you cannot atte ![Example 1 Diagram](https://assets.leetcode.com/uploads/2021/09/21/picture1.png) -**Input:** events = [[1,3,2],[4,5,2],[1,5,5]] +**Input:** events = \[\[1,3,2],[4,5,2],[1,5,5]] **Output:** 5 @@ -32,7 +32,7 @@ Note that the start time and end time is **inclusive**: that is, you cannot atte ![](https://assets.leetcode.com/uploads/2021/09/21/picture3.png) -**Input:** events = [[1,5,3],[1,5,1],[6,6,5]] +**Input:** events = \[\[1,5,3],[1,5,1],[6,6,5]] **Output:** 8 diff --git a/src/main/java/g2001_2100/s2055_plates_between_candles/readme.md b/src/main/java/g2001_2100/s2055_plates_between_candles/readme.md index cc291818..95251118 100644 --- a/src/main/java/g2001_2100/s2055_plates_between_candles/readme.md +++ b/src/main/java/g2001_2100/s2055_plates_between_candles/readme.md @@ -14,7 +14,7 @@ Return _an integer array_ `answer` _where_ `answer[i]` _is the answer to the_ 2 = 5 == 5 = start3 **Example 2:** -**Input:** pairs = [[1,3],[3,2],[2,1]] +**Input:** pairs = \[\[1,3],[3,2],[2,1]] **Output:** [[1,3],[3,2],[2,1]] @@ -42,7 +42,7 @@ The arrangements [[2,1],[1,3],[3,2]] and [[3,2],[2,1],[1,3]] are also valid. **Example 3:** -**Input:** pairs = [[1,2],[1,3],[2,1]] +**Input:** pairs = \[\[1,2],[1,3],[2,1]] **Output:** [[1,2],[2,1],[1,3]] diff --git a/src/main/java/g2101_2200/s2151_maximum_good_people_based_on_statements/readme.md b/src/main/java/g2101_2200/s2151_maximum_good_people_based_on_statements/readme.md index 463da65c..bae18611 100644 --- a/src/main/java/g2101_2200/s2151_maximum_good_people_based_on_statements/readme.md +++ b/src/main/java/g2101_2200/s2151_maximum_good_people_based_on_statements/readme.md @@ -21,7 +21,7 @@ Return _the **maximum** number of people who can be **good** based on the statem ![](https://assets.leetcode.com/uploads/2022/01/15/logic1.jpg) -**Input:** statements = [[2,1,2],[1,2,2],[2,0,2]] +**Input:** statements = \[\[2,1,2],[1,2,2],[2,0,2]] **Output:** 2 @@ -54,7 +54,7 @@ Return _the **maximum** number of people who can be **good** based on the statem ![](https://assets.leetcode.com/uploads/2022/01/15/logic2.jpg) -**Input:** statements = [[2,0],[0,2]] +**Input:** statements = \[\[2,0],[0,2]] **Output:** 1