๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.65K subscribers
5.62K photos
3 videos
95 files
10.9K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
public static int findBestPath(int n, int m, int max_t, List beauty, List u, List v, List t) {
// Write your code here
createGraph(n, m, u, v, t);
// int twoWay = dfs(0, beauty, max_t);
// visited = new HashSet<>();
// cycle(0, beauty, max_t, beauty.get(0), 0);
visited.add(0);
dfs2(0, beauty, max_t, beauty.get(0));
return totalAns;

}

static int totalAns = Integer.MIN_VALUE;

public static void dfs2(int node, List beauty, int maxT, int sum) {

if (node == 0) {
    totalAns = Math.max(totalAns, sum);

}
for (int nbr : map.get(node).keySet()) {

    int time = map.get(node).get(nbr);
    if (time <= maxT) {
        if (!visited.contains(nbr)) {
            visited.add(nbr);
            dfs2(nbr, beauty, maxT - time, sum + beauty.get(nbr));
            visited.remove(nbr);
        } else
            dfs2(nbr, beauty, maxT - time, sum);

    }

}
}

static HashSet<Integer> visited = new HashSet<>();
static HashMap<Integer, HashMap<Integer, Integer>> map = new HashMap<>();

public static void createGraph(int n, int m, List u, List v, List t) {
for (int i = 0; i < n; ++i) {
map.put(i, new HashMap<>());
}

for (int i = 0; i < m; ++i) {
    int x = u.get(i);
    int y = v.get(i);
    int z = t.get(i);

    map.get(x).put(y, z);
    map.get(y).put(x, z);
}
}

Find best path
Linkedln โœ…
int getMinimumCost(vector<int> arr)
{
    long long maxDiff = 0 ;
    int index = -1 ;
    for(int i=  0 ; i < arr.size()-1 ; i++)
    {
        if(abs(arr[i]-arr[i+1]) > maxDiff)
        {
           maxDiff = abs(arr[i]-arr[i+1]) ;
           index = i ;
        }
    }
   
    int median = (arr[index] + arr[index+1]) / 2 ;
   
   
    long long initialCost = 0 ;
   
    for(int i=  0 ; i < arr.size()-1 ; i++)
        initialCost += pow(arr[i]-arr[i+1],2) ;
   
    initialCost = initialCost + pow(arr[index] - median,2) + pow(median - arr[index+1],2) - pow(arr[index] - arr[index+1] ,2) ;
   
    return initialCost ;
}

Linkedln โœ…
DE SHAW hiring Ascend Educare is a six-month mentorship program for women in technology

Eligibility Criteria:

Second/third-year student in a BTech/BE program

Third/fourth-year student in a five-year dual degree program (BTech + MTech, BE + ME)

First-year student in a two-year MTech/MS/MCA program

Second-year student in a three-year MCA program;


https://www.deshawindia.com/forms/REQ5Qjg1RTktM0Q5NC00QjhFLTkyNDYtNTE1OENENjE5QjhB
Software Engineer Swaraj Kumar is offering a group session to help you ace the FAANG interviews and to answer your questions and doubts directly ๐ŸŽฏ

Heโ€™ll be sharing the following:

- Experience and insights on the interview process
- How to enhance your skill set
- Tips to grab high-paying job opportunities
- Ways to build your resume.

Register now - https://visit.preplaced.in/n8u

The session will also include a live Q&A, where the mentor will answer all your doubts and concerns:)

Don't miss out!