WhiteHat Coding
الذهاب إلى القناة على Telegram
650
المشتركون
لا توجد بيانات24 ساعات
-27 أيام
-330 أيام
أرشيف المشاركات
Directed Soldier
int directedSoldiers(int n, vector &a) {
// Write your code here.
int d=0;
vector p, p1;
vector b = a;
reverse(b.begin(), b.end());
int k=0;
for (int i = 0; i < n; i++) {
if (b[i]==0) {
k++;
}
p1.push_back(k);
}
for (int i = 0; i < n; i++) {
if (a[i] == 1) {
d += 1;
}
p.push_back(d);
}
reverse(p1.begin(), p1.end());
p1.push_back(0);
int res = count(a.begin(), a.end(), 0);
for (int i = 0; i < n; i++) {
int x = p[i] + p1[i + 1];
res = min(res, x);
}
return res;
}
#include <vector>
std::vector<int> binaryQueries(int n, std::vector<int>& a, int q, std::vector<std::vector<int>>& queries) {
std::vector<int> result;
for (const auto& query : queries) {
int left = query[0];
int right = query[1];
int x = query[2];
// Update the array 'A' according to the query
for (int i = left; i <= right; i++) {
a[i] ^= x;
}
// Calculate the bitwise OR for the specified range
int orResult = a[left];
for (int i = left + 1; i <= right; i++) {
orResult |= a[i];
}
result.push_back(orResult);
}
return result;
}
binary quires
Any campus placement or Offcampus Exam.
Help available in All exams.
Book your slot.👨💻
Contact @IHATEU_183 ✅
Its paid ✅
100% clearance guarantee 🔥🔥
Share @Coding_000 ❤️
Visa Mock Interview available✅
Anyone need DM @Iloveu_143👨💻
Full visa preparation materials and mock to be taken....Daily..😊
Share @Coding_000❤️
https://amazonvirtualhiring.hirepro.in/registration/incta/ju0f4/apply/?j=57594&e=13560
If you received mail instantly✅
Any exam Feel Free to ask help...✅
https://t.me/Free_coding000
Share our Free helping channel @whitehatcoding❤️
#include <iostream>
using namespace std;
int main()
{
int number,n;
cin>>number>>n;
int first=0,sec=1;
int fib=0;
while(fib<=number)
{
fib=first+sec;
first=sec;
sec=fib;
if(fib==number)
{
while(n--)
{
fib=first+sec;
first=sec;
sec=fib;
}
}
}
cout<<fib;
return 0;
}
*Company Name:*
NVIDIA
*Batch:*
2023 pass-outs.
*CTC:*
26 LPA ( for B.Tech )
29 LPA ( for M.Tech )
https://docs.google.com/forms/d/e/1FAIpQLSdb-DgfEyLs0-28hPa9asMTE-5bQAvsqsyBmpWkYFFiZF7Yng/viewform
Guys share this channel to ur friends...
Any exams...pls msg here...i will help You...Free...✅
Share @whitehatcoding❤️
Team - #Love #whitehatcoding
