-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_duplicate.c
33 lines (30 loc) · 1.16 KB
/
check_duplicate.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* check_duplicate.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sanglee2 <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/20 20:19:57 by sanglee2 #+# #+# */
/* Updated: 2023/05/22 22:50:21 by sanglee2 ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int check_duplicate_arg(t_deq *deq)
{
t_node* temp1;
t_node* temp2;
temp1 = deq->a_top;
while(temp1)
{
temp2 = temp1->next;
while(temp2)
{
if (temp2->content == temp1->content)
return (1);
temp2 = temp2->next;
}
temp1 = temp1->next;
}
return (0);
}