1. 学习
  2. /
  3. 课程
  4. /
  5. Optimizing Code in Java

Connected

练习

Implementing a social network

You're developing a social networking application that needs to analyze potential connections between users. You need to implement a method that generates all possible pairs of users from a list.

说明

100 XP
  • For each index i, assign the ith user in elements as the first element of the pair.
  • For each index j, assign the jth user in elements as the second element of the pair.
  • Return the result with all your pairs.