#include<bits/stdc++.h>
using namespace std;
vector<pair<int,int>>adj[1000001];
int main(){
int n;
cin>>n;
unordered_map<int,int>mp;
for(int i=0;i<n;++i){
int x;
cin>>x;
mp[x]=INT_MAX;
}
int e;
cin>>e;
for(int i=0;i<e;++i){
int x,y,d;
cin>>x>>y>>d;
adj[x].push_back({y,d});
}
int src,dest;
cin>>src>>dest;
set<pair<int,int>>s;
mp[src]=0;
s.insert({0,src});
while(!s.empty()){
pair<int,int>tmp=*(s.begin());
s.erase(s.begin());
int u=tmp.second;
for(auto i=adj[u].begin();i!=adj[u].end();++i){
int v=(*i).first;
int weight=(*i).second;
if(mp[v]>mp[u]+weight){
if(mp[v]!=INT_MAX)
s.erase(s.find({mp[v],v}));
mp[v]=mp[u]+weight;
s.insert({mp[v],v});
}
}
}
if(mp[dest]==INT_MAX)
cout<<"-1"<<endl;
else
cout<<mp[dest]<<endl;
return 0;
}
Juspay (C++)โ
using namespace std;
vector<pair<int,int>>adj[1000001];
int main(){
int n;
cin>>n;
unordered_map<int,int>mp;
for(int i=0;i<n;++i){
int x;
cin>>x;
mp[x]=INT_MAX;
}
int e;
cin>>e;
for(int i=0;i<e;++i){
int x,y,d;
cin>>x>>y>>d;
adj[x].push_back({y,d});
}
int src,dest;
cin>>src>>dest;
set<pair<int,int>>s;
mp[src]=0;
s.insert({0,src});
while(!s.empty()){
pair<int,int>tmp=*(s.begin());
s.erase(s.begin());
int u=tmp.second;
for(auto i=adj[u].begin();i!=adj[u].end();++i){
int v=(*i).first;
int weight=(*i).second;
if(mp[v]>mp[u]+weight){
if(mp[v]!=INT_MAX)
s.erase(s.find({mp[v],v}));
mp[v]=mp[u]+weight;
s.insert({mp[v],v});
}
}
}
if(mp[dest]==INT_MAX)
cout<<"-1"<<endl;
else
cout<<mp[dest]<<endl;
return 0;
}
Juspay (C++)โ
#include<bits/stdc++.h>
using namespace std;
vector<int>adj[1000001];
void solve(int src,int dest,unordered_map<int,int>&mp){
mp[src]=1;
for(int i=0;i<adj[src].size();++i){
if(!mp[adj[src][i]]){
solve(adj[src][i],dest,mp);
}
}
}
int main(){
int n;
cin>>n;
unordered_map<int,int>mp;
for(int i=0;i<n;++i){
int x;
cin>>x;
mp[x]=0;
}
int e;
cin>>e;
for(int i=0;i<e;++i){
int x,y;
cin>>x>>y;
adj[x].push_back(y);
}
int src,dest;
cin>>src>>dest;
solve(src,dest,mp);
cout<<mp[dest]<<endl;
return 0;
}
Juspay (C++)โ
using namespace std;
vector<int>adj[1000001];
void solve(int src,int dest,unordered_map<int,int>&mp){
mp[src]=1;
for(int i=0;i<adj[src].size();++i){
if(!mp[adj[src][i]]){
solve(adj[src][i],dest,mp);
}
}
}
int main(){
int n;
cin>>n;
unordered_map<int,int>mp;
for(int i=0;i<n;++i){
int x;
cin>>x;
mp[x]=0;
}
int e;
cin>>e;
for(int i=0;i<e;++i){
int x,y;
cin>>x>>y;
adj[x].push_back(y);
}
int src,dest;
cin>>src>>dest;
solve(src,dest,mp);
cout<<mp[dest]<<endl;
return 0;
}
Juspay (C++)โ
๐1
Nick's check code โ
(Python 3)
(Python 3)
Two Operation โ
Python 3
Python 3
๐1
TCS IRA answers...
Java answers
26)7.25
27)3rd option
28)55
29)the output will be 4 3 undefined 1
30)124
31)it will be concatenate both the strings and print as 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9,10
32)//
33)object
34)<img src="jtp.png">
35)u
36)Grade:C
37)10 11 Aman
38)a=22.5,b=21.0
39)5070
40)2345
41)Learning Java Learning Java
42)6.3
43)6789
41) Learning Java learning Java
42) 6,3
43)6789
44) class MyClass
45)56 1
46) exdends
47) javt
48) public static int cal(a,name)
49) composition
50) math()
Java answers
26)7.25
27)3rd option
28)55
29)the output will be 4 3 undefined 1
30)124
31)it will be concatenate both the strings and print as 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9,10
32)//
33)object
34)<img src="jtp.png">
35)u
36)Grade:C
37)10 11 Aman
38)a=22.5,b=21.0
39)5070
40)2345
41)Learning Java Learning Java
42)6.3
43)6789
41) Learning Java learning Java
42) 6,3
43)6789
44) class MyClass
45)56 1
46) exdends
47) javt
48) public static int cal(a,name)
49) composition
50) math()
๐2
TCS IRA JAVA ANSWERS
1)Robotic
2)true
3)native application
4)big data
1)Robotic
2)true
3)native application
4)big data
๐โ ๏ธโJobs Updatesโโ ๏ธ๐
ColorTokens - https://t.me/fresherearth/2534
Infosys Off Campus - https://t.me/fresherearth/2535
TCS - https://t.me/fresherearth/2530
โ Share with your friends
Telegram - t.me/superexams
ColorTokens - https://t.me/fresherearth/2534
Infosys Off Campus - https://t.me/fresherearth/2535
TCS - https://t.me/fresherearth/2530
โ Share with your friends
Telegram - t.me/superexams
โ ๏ธโผ๏ธIBM Exam Discussion/ Help Group
๐Date - 18 May 2022
๐@superexams
๐@superexams
๐@superexams
โผ๏ธJoin Fast๐๐ปโโ๏ธ๐๐ปโโ๏ธ๐๐ปโโ๏ธ
๐Date - 18 May 2022
๐@superexams
๐@superexams
๐@superexams
โผ๏ธJoin Fast๐๐ปโโ๏ธ๐๐ปโโ๏ธ๐๐ปโโ๏ธ
โ ๏ธโ ๏ธโ ๏ธ#HackerRank Rest API: Country Code - HackerRank Python Solutions
import urllib.request
import json
import re
def getPhoneNumbers(country,phoneNumber):
api="https://jsonmock.hackerrank.com/api/countries?name="
url = api+country
with urllib.request.urlopen(url) as response:
html = response.read()
html = json.loads(html)
code = html["data"][0]["callingCodes"][0]
phoneNumber="+"+str(code)+" "+str(phoneNumber)
return phoneNumber
๐1
โ ๏ธ๐ฐโ
If anyone wants to share their interview experience.
Ping me -> @superexamsbot
Ping me -> @superexamsbot
Binary Timer
๐3
โ ๏ธ Reminder - who didn't apply yet
IBM - t.me/fresherearth/2492
Replicon - t.me/fresherearth/2494
Infosys - t.me/fresherearth/2496
Hexaware - t.me/fresherearth/2498
ColorTokens - t.me/fresherearth/2500
Reliance Industries - t.me/fresherearth/2502
GlobalLogic - t.me/fresherearth/2504
AstraZeneca - t.me/fresherearth/2507
Texas Instruments - t.me/fresherearth/2562
Thinkitive Technologies - t.me/fresherearth/2563
Coupa Software - t.me/fresherearth/2564
โ Share in ur College WhatsApp Groups
๐Direct & 100% Ads Free Links
Telegram - t.me/fresherearth
IBM - t.me/fresherearth/2492
Replicon - t.me/fresherearth/2494
Infosys - t.me/fresherearth/2496
Hexaware - t.me/fresherearth/2498
ColorTokens - t.me/fresherearth/2500
Reliance Industries - t.me/fresherearth/2502
GlobalLogic - t.me/fresherearth/2504
AstraZeneca - t.me/fresherearth/2507
Texas Instruments - t.me/fresherearth/2562
Thinkitive Technologies - t.me/fresherearth/2563
Coupa Software - t.me/fresherearth/2564
โ Share in ur College WhatsApp Groups
๐Direct & 100% Ads Free Links
Telegram - t.me/fresherearth
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ pinned ยซโ ๏ธ Reminder - who didn't apply yet IBM - t.me/fresherearth/2492 Replicon - t.me/fresherearth/2494 Infosys - t.me/fresherearth/2496 Hexaware - t.me/fresherearth/2498 ColorTokens - t.me/fresherearth/2500 Reliance Industries - t.me/fresherearth/2502 GlobalLogicโฆยป
Trust me๐โค๏ธ No one will support you, if you have to achieve something. You have to support yourself โค๏ธ๐ฏ #yehiSachaiHai
๐6๐คฉ1
After every rejection from an interview, Instead of feeling bad, blaming luck, or abusing the interviewer,
stand in front of a mirror and say "Is rejection se ye pta chal gya ki itne se nhi ho, mujhe abhi aur mehnat krna parega" ๐๐ฏ And start preparing for the next interviewโค๏ธโค๏ธ
P.S. Relatable to me because recently I also got rejected from one๐๐ฅฒ All the bestโค๏ธ๐ฏ
#interview #motivateyourself
stand in front of a mirror and say "Is rejection se ye pta chal gya ki itne se nhi ho, mujhe abhi aur mehnat krna parega" ๐๐ฏ And start preparing for the next interviewโค๏ธโค๏ธ
P.S. Relatable to me because recently I also got rejected from one๐๐ฅฒ All the bestโค๏ธ๐ฏ
#interview #motivateyourself
๐7