zvoulgaris

Doubled Pairs

Oct 21st, 2020
597
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Doubled Pairs drill
  2.  
  3. function main(x::Array{Int64, 1})::Bool # It's unnecessary to set the input & output types, but Rust is wearing off on me!
  4.     s = Set(x);
  5.     flag = false;
  6.  
  7.     for element in s
  8.         element2 = 2element;
  9.        
  10.         if element2 in s
  11.             println((element, element2));
  12.             flag = true;
  13.         end
  14.     end
  15.    
  16.     flag
  17. end
  18.  
RAW Paste Data