summaryrefslogtreecommitdiff
path: root/rushs/evalexpr/hill_array/hill_array.c
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-10-11 22:19:00 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-10-11 22:19:00 +0200
commit73c2b00a10c5786ddeeacc915e233fd4df1c9321 (patch)
treee299ea4e8ac161b2b21170172ff8f182c1c3fe1a /rushs/evalexpr/hill_array/hill_array.c
parentc9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (diff)
fix: evalexpr & tinyprintf contenaient toute la piscine
Diffstat (limited to 'rushs/evalexpr/hill_array/hill_array.c')
-rw-r--r--rushs/evalexpr/hill_array/hill_array.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/rushs/evalexpr/hill_array/hill_array.c b/rushs/evalexpr/hill_array/hill_array.c
deleted file mode 100644
index 14d3a85..0000000
--- a/rushs/evalexpr/hill_array/hill_array.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "hill_array.h"
-
-int top_of_the_hill(int tab[], size_t len)
-{
- if (len == 0)
- {
- return -1;
- }
-
- int top = 0;
- size_t i = 0;
-
- while (i + 1 < len && tab[i] <= tab[i + 1])
- {
- if (tab[i] < 0 || tab[i + 1] < 0)
- {
- return -1;
- }
- if (tab[i] != tab[i + 1])
- {
- top = i + 1;
- }
- i++;
- }
-
- while (i + 1 < len && tab[i] >= tab[i + 1])
- {
- if (tab[i] < 0 || tab[i + 1] < 0)
- {
- return -1;
- }
- i++;
- }
-
- if (i + 1 == len)
- {
- return top;
- }
- else
- {
- return -1;
- }
-}