Skip to main content
add constraints compared to Hackerrank problem statement constraints.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 28
  • 52

2. 1 <= n <= 100000

3. 1 <= m <= min(n(n-1)/2, 200000)

2. 1 <= n <= 100000

3. 1 <= m <= min(n(n-1)/2, 200000)

add more comments about activities in the contest, show the weakness of graph algorithm in design.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 28
  • 52

The algorithm is the hard one and also one of Hackerrank weekcode \$28\$ contest in January 2017, I spent a few hours in the contest to read the problem statement and also read all the discussion. I did some study on disjoint set, but I did not come out clear ideas how to divide groups, implement a graph. I learned through the discussion that the friendship should be added to maximize the value, and studied the test case in the following (5 nodes in the graph):

Add name variable in the class GraphNode to help identify node; add the test case to help understand the algorithm, and be able to add comment to explain the function Connect; use meaningful variable names after code review. I already spent hours on the algorithm and really look forward to work hard on graph algorithm and be able to perform one graph algorithm in week of code contest in short future.

The algorithm is the hard one and also one of Hackerrank weekcode \$28\$ contest in January 2017, I spent a few hours in the contest to read the problem statement and also read all the discussion. I learned through the discussion that the friendship should be added to maximize the value, and studied the test case in the following (5 nodes in the graph):

Add name variable in the class GraphNode to help identify node; add the test case to help understand the algorithm, and be able to add comment to explain the function Connect; I already spent hours on the algorithm and really look forward to work hard on graph algorithm and be able to perform one graph algorithm in week of code contest in short future.

The algorithm is the hard one and also one of Hackerrank weekcode \$28\$ contest in January 2017, I spent a few hours in the contest to read the problem statement and also read all the discussion. I did some study on disjoint set, but I did not come out clear ideas how to divide groups, implement a graph. I learned through the discussion that the friendship should be added to maximize the value, and studied the test case in the following (5 nodes in the graph):

Add name variable in the class GraphNode to help identify node; add the test case to help understand the algorithm, and be able to add comment to explain the function Connect; use meaningful variable names after code review. I already spent hours on the algorithm and really look forward to work hard on graph algorithm and be able to perform one graph algorithm in week of code contest in short future.

add some encouraging words for future week code contest performance
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 28
  • 52
  1. add name variable in the class GraphNode to help identify node.

  2. add the test case to help understand the algorithm, and be able to add comment to explain the function Connect.

  3. There are so many submissions, so many ways to implement the graph, I learn one algorithm a time.

Add name variable in the class GraphNode to help identify node; add the test case to help understand the algorithm, and be able to add comment to explain the function Connect; I already spent hours on the algorithm and really look forward to work hard on graph algorithm and be able to perform one graph algorithm in week of code contest in short future.

  1. add name variable in the class GraphNode to help identify node.

  2. add the test case to help understand the algorithm, and be able to add comment to explain the function Connect.

  3. There are so many submissions, so many ways to implement the graph, I learn one algorithm a time.

Add name variable in the class GraphNode to help identify node; add the test case to help understand the algorithm, and be able to add comment to explain the function Connect; I already spent hours on the algorithm and really look forward to work hard on graph algorithm and be able to perform one graph algorithm in week of code contest in short future.

fix the layout issue.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 28
  • 52
Loading
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 28
  • 52
Loading