Mohit and Swiggy

Sort by

recency

|

6 Discussions

|

  • + 1 comment

    java solution using kruskal is giving TLE which author posted in C++. How does that supposed to work? Or should I post this question on leetcode who can create better test cases and better runtime benchmark?

  • + 0 comments

    K's MST algo is giving timeouts. Anyone found a way to solve this? Any hints will be appreciated.

  • + 0 comments

    huy peeps!!! i have encountered a problem.how to travel back to junction 0 once we have explored all the junctions...???please give the code in C or C++..

  • + 1 comment

    import math import os import random import re import sys import numpy as np

    def solve(n, roads): # Write your code here a = np.array(roads) b = a[:,n] c = np.sum(b)

    return (c)
    

    if name == 'main':

    ## fptr = open(os.environ['OUTPUT_PATH'], 'w')

    first_multiple_input = input().rstrip().split()
    
    n = int(first_multiple_input[0])
    
    
    m = int(first_multiple_input[1])
    
    
    roads = []
    
    for _ in range(m):
        roads.append(list(map(int, input().rstrip().split())))
    
    
    result = solve(n, roads)
    print(result)
    

    **## fptr.write(str(result) + '\n')

    #

    fptr.close()**

  • + 0 comments

    it tsp travelling saleman prblm