๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
const int MOD = 1000000007;
using namespace std;
void dfs(int node, const unordered_map<int, vector<pair<int, int>>>& tree, vector<long long>& magnitudes) {
auto it = tree.find(node);
if (it != tree.end()) {
for (const auto& neighbor : it->second) {
int next_node = neighbor.first;
int weight = neighbor.second;
magnitudes[next_node] = (magnitudes[node] * weight) % MOD;
dfs(next_node, tree, magnitudes);
}
}
}
vector<int> findEquivalentMagnitude(int unit_nodes, vector<int> unit_from, vector<int> unit_to, vector<int> unit_weight, int x) {
unordered_map<int, vector<pair<int, int>>> tree;
for (int i = 0; i < unit_from.size(); ++i) {
tree[unit_from[i]].emplace_back(unit_to[i], unit_weight[i]);
}
vector<long long> magnitudes(unit_nodes + 1, -1);
magnitudes[1] = x;
dfs(1, tree, magnitudes);
vector<int> result(unit_nodes);
for (int i = 1; i <= unit_nodes; ++i) {
result[i - 1] = magnitudes[i];
}
return result;
}
UKGโ
#include <vector>
#include <unordered_map>
#include <algorithm>
const int MOD = 1000000007;
using namespace std;
void dfs(int node, const unordered_map<int, vector<pair<int, int>>>& tree, vector<long long>& magnitudes) {
auto it = tree.find(node);
if (it != tree.end()) {
for (const auto& neighbor : it->second) {
int next_node = neighbor.first;
int weight = neighbor.second;
magnitudes[next_node] = (magnitudes[node] * weight) % MOD;
dfs(next_node, tree, magnitudes);
}
}
}
vector<int> findEquivalentMagnitude(int unit_nodes, vector<int> unit_from, vector<int> unit_to, vector<int> unit_weight, int x) {
unordered_map<int, vector<pair<int, int>>> tree;
for (int i = 0; i < unit_from.size(); ++i) {
tree[unit_from[i]].emplace_back(unit_to[i], unit_weight[i]);
}
vector<long long> magnitudes(unit_nodes + 1, -1);
magnitudes[1] = x;
dfs(1, tree, magnitudes);
vector<int> result(unit_nodes);
for (int i = 1; i <= unit_nodes; ++i) {
result[i - 1] = magnitudes[i];
}
return result;
}
UKGโ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Zeta
Role: SDE 1 (Backend) and SDE 1 (Frontend)
Experience Required: 0-1 years
Apply:
1) Backend: https://jobs.lever.co/zeta/f7a35ddf-fb28-4098-886b-156460082cb7
2) Frontend: https://jobs.lever.co/zeta/719928df-d136-41a0-93e8-2ca93bad96ee
Role: SDE 1 (Backend) and SDE 1 (Frontend)
Experience Required: 0-1 years
Apply:
1) Backend: https://jobs.lever.co/zeta/f7a35ddf-fb28-4098-886b-156460082cb7
2) Frontend: https://jobs.lever.co/zeta/719928df-d136-41a0-93e8-2ca93bad96ee
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Bentley
Role: Associate Software Quality Analyst (QA Profile)
Batch eligible: 2023 and 2024 grads
Apply: https://jobs.bentley.com/job/Kolkata-Associate-Software-Quality-Analyst/1175269200/
Role: Associate Software Quality Analyst (QA Profile)
Batch eligible: 2023 and 2024 grads
Apply: https://jobs.bentley.com/job/Kolkata-Associate-Software-Quality-Analyst/1175269200/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Email: hr@webinfinitesolutions.com
Contact: +919465532412
Contact: +919465532412
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Send your updated resume at:
hr@trioangle.com
hr@trioangle.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: The Trade Desk
Role: Software Engineering Intern
Batch eligible: 2025 grads (2026 grads can also try)
Apply: https://boards.greenhouse.io/thetradedesk/jobs/4435073007
Role: Software Engineering Intern
Batch eligible: 2025 grads (2026 grads can also try)
Apply: https://boards.greenhouse.io/thetradedesk/jobs/4435073007
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
public static int countMeetings(int[] firstDay, int[] lastDay) {
int n = firstDay.length;
TreeSet<Integer> availableDays = new TreeSet<>();
for (int i = 1; i <= 100000; i++) {
availableDays.add(i);
}
int count = 0;
for (int i = 0; i < n; i++) {
int start = firstDay[i];
int end = lastDay[i];
Integer day = availableDays.ceiling(start);
if (day != null && day <= end) {
count++;
availableDays.remove(day);
}
}
return count;
}
Standard chartered โ
int n = firstDay.length;
TreeSet<Integer> availableDays = new TreeSet<>();
for (int i = 1; i <= 100000; i++) {
availableDays.add(i);
}
int count = 0;
for (int i = 0; i < n; i++) {
int start = firstDay[i];
int end = lastDay[i];
Integer day = availableDays.ceiling(start);
if (day != null && day <= end) {
count++;
availableDays.remove(day);
}
}
return count;
}
Standard chartered โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
WE'RE NOW ON DISCORD โค
OUR Coding Community โจ
We've launched our new discord server, you all can join there ASAP
Here's the exclusive link ๐
https://discord.gg/5YrwWzaF
Join fast. See you all โค
OUR Coding Community โจ
We've launched our new discord server, you all can join there ASAP
Here's the exclusive link ๐
https://discord.gg/5YrwWzaF
Join fast. See you all โค
Discord
Join the Coding Zone Discord Server!
Check out the Coding Zone community on Discord - hang out with 231 other members and enjoy free voice and text chat.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: ADP
Role: Associate Software Engineer
Batch eligible: 2024 and 2025 grads
Apply: https://tech.adp.com/en/jobs/5001062749106/associate-software-engineer/
Role: Associate Software Engineer
Batch eligible: 2024 and 2025 grads
Apply: https://tech.adp.com/en/jobs/5001062749106/associate-software-engineer/
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
int mrt2(const string& st) {
int n = st.length();
vector<vector<int>> lst(n, vector<int>(n, 0));
for (int i = 0; i < n; ++i)
lst[i][i] = 1;
for (int k = 2; k <= n; ++k) {
for (int i = 0; i <= n - k; ++i) {
int j = i + k - 1;
if (st[i] == st[j]) {
if (k == 2)
lst[i][j] = 2;
else
lst[i][j] = lst[i + 1][j - 1] + 2;
} else {
lst[i][j] = max(lst[i + 1][j], lst[i][j - 1]);
}
}
}
return lst[0][n - 1];
}
int delete_op(const string& st) {
int n = st.length();
int lps = mrt2(st);
return n - lps;
}
bool rearrange(const string& S) {
unordered_map<char, int> freq;
for (char c : S) {
freq[c]++;
}
int odd_count = 0;
for (auto& p : freq) {
if (p.second % 2 == 1)
odd_count++;
}
return odd_count <= 1;
}
vector<int> mrt(const string& S, const vector<pair<int, int>>& arr) {
vector<int> res;
for (auto& range : arr) {
string temp = S.substr(range.first - 1, range.second - range.first + 1);
int result = rearrange(temp) ? 0 : delete_op(temp);
res.push_back(result);
}
return res;
}
String and queries
OLAโ
๐1
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int minimizeDiff(int a, vector<int>& b) {
int c = b.size();
int d = *max_element(b.begin(), b.end());
int e = *min_element(b.begin(), b.end());
if ((d - e) <= a) {
return (d - e);
}
int f = (d + e) / 2;
for (int g = 0; g < c; g++) {
if (b[g] > f) {
b[g] -= a;
} else {
b[g] += a;
}
}
d = *max_element(b.begin(), b.end());
e = *min_element(b.begin(), b.end());
return (d - e);
}
ICE CREAM Sticks โ
Intuit
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1e9 + 7;
ll add(ll x, ll y)
{
return (x + y) % mod;
}
ll mul(ll x, ll y)
{
return (x * y) % mod;
}
ll dp[101][101][101];
ll solver(ll i, ll maxm, ll n, ll m, ll totalCost)
{
if (i == n)
{
if (totalCost == 0)
{
return 1;
}
else
{
return 0;
}
}
if (dp[i][maxm][totalCost] != -1)
{
return dp[i][maxm][totalCost];
}
ll temp = 0;
for (int j = 1;j <= m;j++)
{
if (j > maxm)
{
temp = add(temp, solver(i + 1, j, n, m, totalCost - 1));
}
else
{
temp = add(temp, solver(i + 1, maxm, n, m, totalCost));
}
}
return dp[i][maxm][totalCost] = temp;
}
void solve(vector<ll>n, vector<ll> m, vector<ll> totalCost)
{
ll q = n.size();
vector<ll>answer(q);
for (int j = 0;j < q;j++)
{
memset(dp, -1, sizeof(dp));
ll N= n[j];
ll M= m[j];
ll Tot= totalCost[j];
ll ans = 0;
for (int i = 1;i <= M;i++)
{
ans = add(ans, solver(1, i, N, M, Tot));
}
answer.push_back(ans);
}
for (int j = 0;j < q;j++)
{
cout << answer[j] << endl;
}
return;
}
/// reconstracting array โ