I have the list of APIs, Input = [WriteConsoleA, WSAStartup, RegCloseKey, RegCloseKey, RegCloseKey, NtTerminateProces, RegCloseKey]
expected output = [WriteConsoleA, WSAStartup, RegCloseKey, NtTerminateProces, RegCloseKey]
I have the list of APIs, Input = [WriteConsoleA, WSAStartup, RegCloseKey, RegCloseKey, RegCloseKey, NtTerminateProces, RegCloseKey]
expected output = [WriteConsoleA, WSAStartup, RegCloseKey, NtTerminateProces, RegCloseKey]
Input = ["WriteConsoleA", "WSAStartup", "RegCloseKey", "RegCloseKey", "RegCloseKey", "NtTerminateProces", "RegCloseKey"]
Output = []
api=Input[0]
for index in range(1,len(Input)):
if api!=Input[index]:
Output.append(api)
api=Input[index]
Output.append(api)
print(Output)
Try this hopefully it will work in your case.