Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve Problem 1671. Minimum Number of Removals to Make Mountain Array in C #2264

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ LeetSpace serves as a dedicated workspace and archive for my [LeetCode](https://
| [1662. Check If Two String Arrays are Equivalent](https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/) | Easy | [C](./old-problems/1662/c/solution.c) [C++](./old-problems/1662/solution.cpp) |
| [1668. Maximum Repeating Substring](https://leetcode.com/problems/maximum-repeating-substring/) | Easy | [C](./old-problems/1668/c/solution.c) [C++](./old-problems/1668/solution.cpp) |
| [1669. Merge In Between Linked Lists](https://leetcode.com/problems/merge-in-between-linked-lists/) | Medium | [C++](./old-problems/1669/solution.cpp) |
| [1671. Minimum Number of Removals to Make Mountain Array](https://leetcode.com/problems/minimum-number-of-removals-to-make-mountain-array/) | Hard | [C++](./old-problems/1671/solution.cpp) |
| [1671. Minimum Number of Removals to Make Mountain Array](https://leetcode.com/problems/minimum-number-of-removals-to-make-mountain-array/) | Hard | [C](./old-problems/1671/c/solution.c) [C++](./old-problems/1671/solution.cpp) |
| [1684. Count the Number of Consistent Strings](https://leetcode.com/problems/count-the-number-of-consistent-strings/) | Easy | [C++](./old-problems/1684/solution.cpp) |
| [1685. Sum of Absolute Differences in a Sorted Array](https://leetcode.com/problems/sum-of-absolute-differences-in-a-sorted-array/) | Medium | [C](./old-problems/1685/c/solution.c) [C++](./old-problems/1685/solution.cpp) |
| [1686. Stone Game VI](https://leetcode.com/problems/stone-game-vi/) | Medium | [C](./old-problems/1686/c/solution.c) [C++](./old-problems/1686/solution.cpp) |
Expand Down
3 changes: 3 additions & 0 deletions old-problems/1671/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
add_c_solution(c_solution c/interface.cpp c/solution.c)

get_dir_name(id)
add_problem_test(test-${id} test.yaml)
target_link_libraries(test-${id} PRIVATE ${c_solution})
10 changes: 10 additions & 0 deletions old-problems/1671/c/interface.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <vector>

extern "C" {
int minimumMountainRemovals(int* nums, int numsSize);
}

int solution_c(std::vector<int> nums) {
return minimumMountainRemovals(nums.data(), nums.size());
;
}
3 changes: 3 additions & 0 deletions old-problems/1671/c/solution.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int minimumMountainRemovals(int* nums, int numsSize) {
return nums[numsSize - 1];
}
1 change: 1 addition & 0 deletions old-problems/1671/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ types:
output: int

solutions:
c:
cpp:
function: minimumMountainRemovals

Expand Down
Loading