#include <stdio.h>
#include <regex.h>
int isPowerOfTwo(const char *binaryString) {
regex_t regex;
int result;
result = regcomp(®ex, "^0*10*$", REG_EXTENDED);
if (result) {
printf("Could not compile regex\n");
return 0;
}
result = regexec(®ex, binaryString, 0, NULL, 0);
regfree(®ex);
if (!result) {
return 1;
} else {
return 0;
}
}
int main() {
int t;
char binaryString[1000];
scanf("%d", &t);
while (t--) {
scanf("%s", binaryString);
if (isPowerOfTwo(binaryString)) {
printf("True\n");
} else {
printf("False\n");
}
}
return 0;
}
Nvidia (Regex) โ
def battery_conversion(s):
e = 0
result = []
i = 0
while i < len(s):
if i < len(s) - 1 and s[i] == 'D' and s[i + 1] == 'E':
result.append('E')
result.append('C')
e += 1
i += 2
elif i < len(s) - 1 and s[i] == 'E' and s[i + 1] == 'D':
result.append('C')
result.append('E')
e += 1
i += 2
else:
result.append(s[i])
i += 1
for _ in range(1):
pass
return e
s = input()
print(battery_conversion(s))
Juspay// Robot battery
Accenture help available with remote access
โค๏ธ 10 am
โค๏ธ 2 pm
โค๏ธ 7 pm
Previous:
https://t.me/code_alphix/2970?single
https://t.me/code_alphix/2959?single
https://t.me/code_alphix/2964
๐ฏ Test Clearanceโถ๏ธ
๐ญ Don't miss the opportunity ๐ญ
DM @mrtrueliving_ixโ
@mrtrueliving_ixโ
Previous:
https://t.me/code_alphix/2970?single
https://t.me/code_alphix/2959?single
https://t.me/code_alphix/2964
๐ฏ Test Clearance
DM @mrtrueliving_ix
@mrtrueliving_ix
Please open Telegram to view this post
VIEW IN TELEGRAM
๐พ1
Apply asap
Batch 23/24/25/26
Multiple roles
Limited application are accepted
DM for test clearance
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g/713
Batch 23/24/25/26
Multiple roles
Limited application are accepted
DM for test clearance
https://whatsapp.com/channel/0029VahiS3p2v1IyoS891Y1g/713
All placement help available
LinkedIn
Rupeek sde
Accenture -7pm
Meesho sde
DM for clearance
@Mrtrueliving_ix
@Mrtrueliving_ix
๐ฏ Remote access { Success}
Don't Miss the opportunity๐ฃ
Check prev proofsโถ๏ธ
Rupeek sde
Accenture -7pm
Meesho sde
DM for clearance
@Mrtrueliving_ix
@Mrtrueliving_ix
๐ฏ Remote access { Success}
Don't Miss the opportunity
Check prev proofs
Please open Telegram to view this post
VIEW IN TELEGRAM
long minOperations(long n) {
if (n == 0)
return 0;
long x = 1;
while (x * 2 <= n)
x <<= 1;
return minOperations(n ^ (x | (x >> 1))) + 1 + x - 1;
}Oracle // minOperations
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
https://app.joinsuperset.com/join/#/signup/student?jp=fd4be287-c8d5-4ace-ac26-6875ca63bc34
Check your eligibility //2024
Join more job updates
@code_alphix
Check your eligibility //2024
Join more job updates
@code_alphix
๐ญ1
Company Name : Walmart Global Tech
Challenge Name : Sparkplug
Batch : 2026 passouts
Role : SDE Internship with 1.1 L stipend/month
Link : https://unstop.com/hackathons/sparkplug-summer-internship-2025-walmart-global-tech-india-1175366?lb=UBWxsub&utm_medium=Share&utm_source=shortUrl
*Only 35 colleges eligible*
Join : @code_alphix
Challenge Name : Sparkplug
Batch : 2026 passouts
Role : SDE Internship with 1.1 L stipend/month
Link : https://unstop.com/hackathons/sparkplug-summer-internship-2025-walmart-global-tech-india-1175366?lb=UBWxsub&utm_medium=Share&utm_source=shortUrl
*Only 35 colleges eligible*
Join : @code_alphix
Unstop
Sparkplug - Summer Internship 2025 - 2024 | 1175366 // Unstop
Find out the best Sparkplug - Summer Internship 2025 that match your interests. Prove your mettle and win exciting prizes like job opportunities and cash rew... | 2024 | 1175366
All placement help available
0๏ธโฃ Cognizant { aptitude+ Coding}
0๏ธโฃ LinkedIn
0๏ธโฃ De shaw
0๏ธโฃ Rupeek
0๏ธโฃ Accenture -On campus
0๏ธโฃ Oracle
Any other OA
{ on // Off campus}
With remote access { high success rate}โถ๏ธ
๐ฏ Test Clearanceโถ๏ธ โ๏ธ
-@mrtrueliving_ix๐ฃ
Any other OA
{ on // Off campus}
With remote access { high success rate}
๐ฏ Test Clearance
-@mrtrueliving_ix
Please open Telegram to view this post
VIEW IN TELEGRAM
COGNIZANT EXAM HELP GROUP pinned ยซAll placement help available 0๏ธโฃ Cognizant { aptitude+ Coding} 0๏ธโฃ LinkedIn 0๏ธโฃ De shaw 0๏ธโฃ Rupeek 0๏ธโฃ Accenture -On campus 0๏ธโฃ Oracle Any other OA { on // Off campus} With remote access { high success rate}โถ๏ธ ๐ฏ Test Clearance โถ๏ธ โ๏ธ -@mrtrueliving_ix๐ฃ ยป
Done ๐
def simpleCipher(encrypted, k):
k = k % 26
decrypted = []
for char in encrypted:
old_pos = ord(char) - ord('A')
new_pos = (old_pos - k) % 26
new_char = chr(new_pos + ord('A'))
decrypted.append(new_char)
return ''.join(decrypted)
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
def findMinincrease(threadSize):
n = len(threadSize)
m = n - 2
if m <= 0:
return 0
groupA_cost = 0
groupB_cost = 0
for f in range(2, n):
index = f - 1
left = threadSize[index - 1]
right = threadSize[index + 1]
target = max(left, right) + 1
cost = target - threadSize[index]
if cost < 0:
cost = 0
if f % 2 == 0:
groupA_cost += cost
else:
groupB_cost += cost
if m % 2 == 1:
return groupA_cost
else:
return min(groupA_cost, groupB_cost)
MOD = 10**9 + 7
def comb3(n):
if n < 3:
return 0
return n * (n - 1) % MOD * (n - 2) % MOD * pow(6, MOD - 2, MOD) % MOD
def evenproduct(nums):
n = len(nums)
even = sum(1 for num in nums if num % 2 == 0)
odd = n - even
total_triplets = comb3(n)
odd_triplets = comb3(odd)
valid_triplets = (total_triplets - odd_triplets + MOD) % MOD
return valid_triplets
Even product// LinkedIn
def findMinIncrease(threadSize):
n = len(threadSize)
if n < 3:
return 0
required_increase = [0] * n
for i in range(1, n - 1):
needed = max(threadSize[i - 1], threadSize[i + 1]) + 1
required_increase[i] = max(0, needed - threadSize[i])
prev0 = (0, 0)
prev1 = (-1, 0)
for i in range(n):
current0 = (0, 0)
current1 = (0, 0)
if i in (0, n - 1):
current0 = max(prev0, prev1, key=lambda x: (x[0], -x[1]))
prev0 = current0
prev1 = (-1, 0)
continue
current0 = max(prev0, prev1, key=lambda x: (x[0], -x[1]))
if prev0[0] != -1:
current1 = (prev0[0] + 1, prev0[1] + required_increase[i])
else:
current1 = (-1, 0)
prev0 = current0
prev1 = current1 if current1[0] != -1 else (-1, 0)
final_ans = max(prev0, prev1, key=lambda x: (x[0], -x[1]))
return final_ans[1]
This media is not supported in your browser
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM