Guest User

Untitled

a guest
Sep 12th, 2019
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool is_unique(int *arr, size_t size, size_t orig_idx) {
  2. for (size_t i = 0, i < size; ++i) {
  3. if (orig_idx != i && arr[orig_idx] == arr[i])
  4. return false;
  5. }
  6. }
  7. }
  8.  
  9.  
  10.  
  11. void print_unique(int *arr, size_t size) {
  12. for (size_t i = 0; i < size; ++i) {
  13. if (is_unique(arr, size, i)) {
  14. std::cout << arr[i] << ' ';
  15. }
  16. }
  17. }
RAW Paste Data