Skip to main content
Post Closed as "Duplicate" by Mr.Wizard list-manipulation
added 4 characters in body
Source Link
yode
  • 27.2k
  • 4
  • 66
  • 174

I want to drop 2 continuous elements every 3 elements,such as I have a list:

list = {3, 5, 5, 5, 2, 5, 1, 0, 5, 0, 4};

I want to get

{3, 5, 5, 5, 1, 0, 4}

Any consiceconsice method can do this?

I want to drop 2 continuous elements every 3 elements,such as I have a list:

list = {3, 5, 5, 5, 2, 5, 1, 0, 5, 0, 4};

I want to get

{3, 5, 5, 5, 1, 0, 4}

Any consice method can do this?

I want to drop 2 continuous elements every 3 elements,such as I have a list:

list = {3, 5, 5, 5, 2, 5, 1, 0, 5, 0, 4};

I want to get

{3, 5, 5, 5, 1, 0, 4}

Any consice method can do this?

Source Link
yode
  • 27.2k
  • 4
  • 66
  • 174

How to delete some element after a certain distance

I want to drop 2 continuous elements every 3 elements,such as I have a list:

list = {3, 5, 5, 5, 2, 5, 1, 0, 5, 0, 4};

I want to get

{3, 5, 5, 5, 1, 0, 4}

Any consice method can do this?