I want to remove duplicate values next to each other, within a list inside a dictionary in python. Give me the best optimized mechanism to achieve this required output.
sample input
mydir = {
"p1":[0,1,1,1,2,2,2,3,3,2,2,1,1],
"p2":[1,2,2,1,1,2,2,3,3,3,0,0]
}
required output
mydir = {
"p1":[0,1,2,3,2,1],
"p2":[1,2,1,2,3,0]
}