SHARE
TWEET

Untitled

a guest Oct 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Complete the sockMerchant function below.
  2. func sockMerchant(n: Int, ar: [Int]) -> Int {
  3.  
  4.     return Dictionary(grouping: ar, by: { $0 } ).reduce(0, { prev, dict in
  5.  
  6.         return prev + dict.value.count / 2
  7.     })
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top