WhiteHat Coding
Ir al canal en Telegram
650
Suscriptores
Sin datos24 horas
-27 días
-330 días
Archivo de publicaciones
https://goo.gle/girl-hackathon-website-2023
FROM 2024-2027 BATCHES
Girls Register Soon
Anybody have any exam
share your Questions to
👉 https://t.me/Free_coding000
i will share codes/ans here for all for free for spreading happiness 😊
Share with your friends and in college groups
Sharing = caring = spreading happiness
class Solution {
public:
int finalDestination(int N, int M, int K, vector> &Roads) {
// code here
vector>> adjList(N);
for (int i = 0; i < N; i++) {
adjList[i] = vector>();
}
for (vector& road : Roads) {
int cityA = road[0];
int cityB = road[1];
int weight = road[2];
adjList[cityA].push_back(make_pair(cityB, weight));
}
vector> dp(N, vector(K + 1, INT_MAX));
dp[0][0] = 0;
for (int k = 0; k <= K; k++) {
for (int i = 0; i < N; i++) {
if (dp[i][k] != INT_MAX) {
for (pair& neighbor : adjList[i]) {
int nextCity = neighbor.first;
int weight = neighbor.second;
if (k + 1 <= K) {
dp[nextCity][k + 1] = min(dp[nextCity][k + 1], dp[i][k] + weight / 2);
}
dp[nextCity][k] = min(dp[nextCity][k], dp[i][k] + weight);
}
}
}
}
int minFuel = INT_MAX;
for (int k = 0; k <= K; k++) {
minFuel = min(minFuel, dp[N - 1][k]);
}
return minFuel == INT_MAX ? -1 : minFuel;
}
};
Final destination code GFG✅
class Solution{
public:
string kPeriodic(string s, int K){
// code here
map<char,int> hm;
for(int i=0;i<s.size();i++){
hm[s[i]]++;
}
int n= s.size();
int res= n/__gcd(n,K);
for(auto t:hm){
if(t.second % res)
return "-1";
}
string p="";
for(auto t:hm){
int pre=t.second/res;
while(pre--)
p+=t.first;
}
string ans="";
while(res--)
ans+=p;
return ans;
}
};
C++
K-Periodic Circular String
Second
GFG Weekly Coding Contest 103
Apply good opportunity 🥳
https://amazonvirtualhiring.hirepro.in/registration/incta/ju0f4/apply/?j=57594&e=13560
Job
Repost from Off Campus Updates | AMAZON | IBM | TCS | WIPRO | WILEY EDGE | VIRTUSA | MINDTREE | COGNIZANT
👉During this Period it's very hard to get a job
Even though exam is qualified
Students are getting failed in Interviews
And Even if the Student got selected, there is no update about Offer letters and joining Dates
🔹It's a crucial period.
Many of you guys might think that "Even after applying to so many job links your Resume is not shortlisting"
🔺Try to Update your Resumes With the Skills required for the company while applying
❌Don't Loose hope guys❌
✅Keep applying to job links
Irrespective of packages
💻Write your Exams Carefully
It's very hard to get opportunity these days
Every Opportunity is Important
Use it Carefully
All The Best ⭐
#coding_000✅❤️
All the best ur jobs
Bless u every one 😇🥹
All your Dreams come true grab every opportunity😊
Guys Velotio codes & some mcq uploaded ....scroll above...check it..
Share @Coding_000❤️✅
