Advertisement
Guest User

Untitled

a guest
Jun 9th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. l = Table[RandomInteger[{1, 10^6}], {1000}];
  2. ls = Sort[l];
  3. index = -1; Do[If[ls[[i]] == ls[[i + 1]], index = i], {i, 1, Length[ls] - 1}];
  4. pos = Position[Partition[l, 20], ls[[index]]];
  5.  
  6. Grid[Partition[l, 20], Frame -> All, FrameStyle -> Lighter[Gray], Background -> {None, None, If[index != -1, {pos[[1]] -> Lighter[Orange],
  7. pos[[2]] -> Lighter[Orange]}, None]}] //
  8. Style[#, FontSize -> 9] &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement