π3
Guys Velotio exam plagiarism will be checked so please change method order and variable name
Share @Coding_000β€οΈ
Share @Coding_000β€οΈ
π1π₯°1
π2
mega.nz
File folder on MEGA
π2π€©1
Guys Velotio codes & some mcq uploaded ....scroll above...check it..
Pythonβ
Share @Coding_000β€οΈβ
Pythonβ
Share @Coding_000β€οΈβ
π3
Any one want projects -mini or Major π Unique projectπ₯π₯
Domain AI/ML
contact -@ILOVEU_143 β€οΈ
Anyone need help in GRE and TOFEL, GMAT, DUOLINGO Exam help π¨βπ»π¨βπ»
SOP , LORβπ
Note -paid π€
shareβ share β @Coding_000
Domain AI/ML
contact -@ILOVEU_143 β€οΈ
Anyone need help in GRE and TOFEL, GMAT, DUOLINGO Exam help π¨βπ»π¨βπ»
SOP , LORβπ
Note -paid π€
shareβ share β @Coding_000
π4π₯°1π1
Any campus placement or Offcampus Exam.
Help available in All exams.
Book your slot.π¨βπ»
Contact @ILOVEU_143β
Its paid β
100% clearance guarantee π₯π₯
Share @Coding_000 β€οΈ
Help available in All exams.
Book your slot.π¨βπ»
Contact @ILOVEU_143β
Its paid β
100% clearance guarantee π₯π₯
Share @Coding_000 β€οΈ
π2π₯°1
Guys!!
If you are seriously looking for good job opportunities,
https://practice.geeksforgeeks.org/contest/job-a-thon-20-hiring-challenge
Do participate :) π₯
If you are seriously looking for good job opportunities,
https://practice.geeksforgeeks.org/contest/job-a-thon-20-hiring-challenge
Do participate :) π₯
practice.geeksforgeeks.org
Contest | Job-A-Thon 20 - Hiring Challenge
With over 1500+ candidates placed in 200+ companies in the last 1 year, Job-A-Thon brings you yet another chance to get placed in top companies. Times may get tough, but for you, Job-A-Thon will be enough!
Watch the Post Contest Analysis - Live:
Mentorβ¦
Watch the Post Contest Analysis - Live:
Mentorβ¦
π1
class Solution{
public:
long long refueling(int X)
{
long long a, b;
for(int i=0; i<X; i++){
a = pow(2,i);
if(a == X)return a;
else if(a>X){
b = pow(2,i-1);
if(abs(X-a) == abs(X-b))return a;
if(abs(X-a) < abs(X-b))return a;
else return b;
}
}
return -1;
}
};
C++
Refueling
public:
long long refueling(int X)
{
long long a, b;
for(int i=0; i<X; i++){
a = pow(2,i);
if(a == X)return a;
else if(a>X){
b = pow(2,i-1);
if(abs(X-a) == abs(X-b))return a;
if(abs(X-a) < abs(X-b))return a;
else return b;
}
}
return -1;
}
};
C++
Refueling
π1
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
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
π2
Guys share the screenshot in large groups and Share with your friends β
π₯ @whitehatcodingβ€οΈ
I don't see anyone sharing π₯²
I don't see anyone sharing π₯²
π1
class Solution {
public:
int finalDestination(int N, int M, int K, vector<vector<int>> &Roads) {
// code here
vector<vector<pair<int, int>>> adjList(N);
for (int i = 0; i < N; i++) {
adjList[i] = vector<pair<int, int>>();
}
for (vector<int>& road : Roads) {
int cityA = road[0];
int cityB = road[1];
int weight = road[2];
adjList[cityA].push_back(make_pair(cityB, weight));
}
vector<vector<int>> dp(N, vector<int>(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<int, int>& 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;
}
};
public:
int finalDestination(int N, int M, int K, vector<vector<int>> &Roads) {
// code here
vector<vector<pair<int, int>>> adjList(N);
for (int i = 0; i < N; i++) {
adjList[i] = vector<pair<int, int>>();
}
for (vector<int>& road : Roads) {
int cityA = road[0];
int cityB = road[1];
int weight = road[2];
adjList[cityA].push_back(make_pair(cityB, weight));
}
vector<vector<int>> dp(N, vector<int>(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<int, int>& 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;
}
};
π5β€2
Guys share the screenshot in large groups and Share with your friends β
π₯ @CODING_000β€οΈ
I don't see anyone sharing π₯²
I don't see anyone sharing π₯²
π2