allcoding1
الذهاب إلى القناة على Telegram
إظهار المزيد
📈 نظرة تحليلية على قناة تيليجرام allcoding1
تُعد قناة allcoding1 (@allcoding1) في القطاع اللغوي الإنكليزية لاعباً نشطاً. يضم المجتمع حالياً 21 607 مشتركاً، محتلاً المرتبة 9 051 في فئة التعليم والمرتبة 19 228 في منطقة الهند.
📊 مؤشرات الجمهور والحراك
منذ تأسيسه في невідомо، حقق المشروع نمواً سريعاً وجمع 21 607 مشتركاً.
بحسب آخر البيانات بتاريخ 27 أغسطس, 2026، تحافظ القناة على نشاط مستقر. خلال آخر 30 يوماً تغيّر عدد الأعضاء بمقدار -357، وفي آخر 24 ساعة بمقدار -10، مع بقاء الوصول العام مرتفعاً.
- حالة التحقق: غير موثّقة
- معدل التفاعل (ER): يبلغ متوسط تفاعل الجمهور 5.05%. وخلال أول 24 ساعة من النشر يحصد المحتوى عادةً 1.19% من ردود الفعل نسبةً إلى إجمالي المشتركين.
- وصول المنشورات: يحصل كل منشور على متوسط 1 092 مشاهدة. وخلال اليوم الأول يجمع عادةً 257 مشاهدة.
- التفاعلات والاستجابة: يتفاعل الجمهور بانتظام؛ متوسط التفاعلات لكل منشور يبلغ 1.
- الاهتمامات الموضوعية: يركز المحتوى على مواضيع رئيسية مثل dsa, stack, namaste, javascript, learning.
📝 الوصف وسياسة المحتوى
وصف القناة غير متوفر.
بفضل وتيرة التحديث المرتفعة (أحدث البيانات بتاريخ 28 أغسطس, 2026) تحافظ القناة على حداثتها ومستوى وصول مرتفع. وتُظهر التحليلات تفاعلاً نشطاً من الجمهور، ما يجعلها نقطة تأثير مهمة ضمن فئة التعليم.
21 607
المشتركون
-1024 ساعات
-757 أيام
-35730 أيام
أرشيف المشاركات
21 597
Roadmap for Front-End Development 🚀
Day 1-5: UI/UX basics (Figma).
Day 6-14: Master HTML & CSS.
Day 15-21: Dive into JavaScript.
Day 21-25: Design-to-code.
Day 26-30: Build projects.
Free Frontend UI/UX Masterclass with Certification, Limited seats available! Register now👇
@itjobsservices
21 597
📌IT learning courses
📌All programing courses
📌Abdul bari courses
📌Ashok IT
📌Linux
📌Networking
📌Design patterns
📌Donet
📌Docker
📌Entity framework
📌Node.js
📌ASP. Net
📌Aps. Net cro
📌java
📌JavaScript
📌full stack developer
Tutorials + Books + Courses + Trainings + Workshops + Educational Resources
🔹Data science
🔹Python
🔹Artificial Intelligence
🔹AWS Certified
🔹Cloud
🔹BIG DATA
🔹Data Analytics
🔹BI
🔹Google Cloud Platform
🔹IT Training
🔹MBA
🔹Machine Learning
🔹Deep Learning
🔹Ethical Hacking
🔹SPSS
🔹Statistics
🔹Data Base
🔹Learning language resources English , 🇫🇷
𝐂𝐘𝐁𝐄𝐑 𝐒𝐄𝐂𝐔𝐑𝐈𝐓𝐘 𝐀𝐋𝐋 𝐂𝐎𝐔𝐑𝐒𝐄
⚡️ Reconnaissance and Footprinting
⚡️ Network Scanning
⚡️ Enumeration
⚡️ Firewalls HIDs Honeypot
⚡️ Malware and Threats
⚡️ Mobile Platform
⚡️ Pentesting
⚡️ Sql Injection
⚡️ System Hacking
⚡️ Web Application
⚡️ Wireless Network
⚡️ Cloud Computing
⚡️ Web Server
⚡️ Social Engineering
⚡️ Session Hijacking
⚡️ Sniffing
⚡️ BufferOverflow
⚡️ Cryptography
⚡️ Denial Of Service
All courses (150 rupees)
Lifetime access
Contact:- @meterials_available
21 597
) ** 2
start_section = end_section = None
for idx, section in enumerate(sections):
for row in section:
if 'S' in row:
start_section = idx
if 'D' in row:
end_section = idx
other_sections = [i for i in range(total_sections) if i not in {start_section, end_section}]
min_path = float('inf')
for perm in itertools.permutations(other_sections):
order = [start_section] + list(perm) + [end_section]
rebuilt_grid = rebuild_grid(order, sections, size, block_size)
min_path = min(min_path, shortest_path(rebuilt_grid, size))
return min_path
if name == "main":
print(main())
ALTERNATING STRING
import java.util.Scanner;
public class AlternatingStringProcessor {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String binaryString = scanner.nextLine();
int length = binaryString.length();
int[] values = new int[length];
for (int i = 0; i < length; i++) {
values[i] = scanner.nextInt();
}
int result = 0;
int currentDigit = binaryString.charAt(0) - '0';
int lastValue = values[0];
for (int i = 1; i < length; i++) {
int nextDigit = binaryString.charAt(i) - '0';
if (nextDigit == currentDigit) {
result += Math.min(lastValue, values[i]);
lastValue = Math.max(lastValue, values[i]);
} else {
currentDigit = nextDigit;
lastValue = values[i];
}
}
System.out.println(result);
}
}
TCS CodeVita
@itjobsservices
21 597
target_idx += 1
sub_idx += 1
total_deletions = len(sub_str) - match_length
return match_length, total_deletions
def process_input():
inp = sys.stdin.read().splitlines()
pos = 0
num_strings = int(inp[pos].strip())
pos += 1
Office rostering code
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
int main() {
int n, m, k, days = 1, activeCount = 0;
cin >> n >> m;
vector<set<int>> connections(n);
for (int i = 0, u, v; i < m; ++i) {
cin >> u >> v;
connections[u].insert(v);
connections[v].insert(u);
}
cin >> k;
vector<bool> active(n, true);
activeCount = n;
while (activeCount < k) {
vector<bool> nextState(n, false);
for (int i = 0; i < n; ++i) {
int neighborCount = 0;
for (int neighbor : connections[i]) {
neighborCount += active[neighbor];
}
if (active[i] && neighborCount == 3) {
nextState[i] = true;
} else if (!active[i] && neighborCount < 3) {
nextState[i] = true;
}
}
active = nextState;
activeCount += count(active.begin(), active.end(), true);
++days;
}
cout << days;
return 0;
}
BUZZ DAY SALE
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ids(n), costs(n);
for (int i = 0; i < n; i++) cin >> ids[i];
for (int i = 0; i < n; i++) cin >> costs[i];
int budget;
cin >> budget;
int maxItems = 0, minCost = 0;
for (int i = 0; i < n; i++) {
int itemCost = costs[i];
int quantity = budget / itemCost;
if (quantity > 0) {
int currentItems = 0, currentCost = 0;
for (int j = 0; j < n; j++) {
if (i != j && ids[i] % ids[j] == 0) {
currentItems += quantity;
currentCost += costs[j] * quantity;
}
}
if (currentItems > maxItems || (currentItems == maxItems && currentCost > minCost)) {
maxItems = currentItems;
minCost = currentCost;
}
}
}
cout << maxItems << " " << minCost << endl;
return 0;
}
Arrange map code
from collections import deque
import itertools
def shortest_path(grid, n):
start, end = None, None
for i in range(n):
for j in range(n):
if grid[i][j] == 'S':
start = (i, j)
elif grid[i][j] == 'D':
end = (i, j)
queue = deque([(start, 0)])
visited = {start}
while queue:
(x, y), distance = queue.popleft()
if (x, y) == end:
return distance
for nx, ny in [(x+1, y), (x-1, y), (x, y+1), (x, y-1)]:
if 0 <= nx < n and 0 <= ny < n and (nx, ny) not in visited and grid[nx][ny] != 'T':
visited.add((nx, ny))
queue.append(((nx, ny), distance + 1))
return float('inf')
def split_grid(grid, size, block):
sections = []
for i in range(0, size, block):
for j in range(0, size, block):
block_section = [grid[x][j:j+block] for x in range(i, i+block)]
sections.append(block_section)
return sections
def rebuild_grid(order, sections, size, block):
full_grid = [["" for _ in range(size)] for _ in range(size)]
num_blocks = size // block
for index, section_index in enumerate(order):
section = sections[section_index]
row_offset = (index // num_blocks) * block
col_offset = (index % num_blocks) * block
for i in range(block):
for j in range(block):
full_grid[row_offset + i][col_offset + j] = section[i][j]
return full_grid
def main():
size, block_size = map(int, input().split())
original_grid = [list(input().strip()) for _ in range(size)]
sections = split_grid(original_grid, size, block_size)
total_sections = (size // block_size
21 597
"10001", "10001", "00100", "10001", "10001", "10000", "10001", "10001", "10001", "10000", "10001", "10010", "00001", "00100", "10001", "01010", "10101", "00000", "00001", "00000"},
{"10001", "11111", "11111", "11111", "11111", "10000", "11111", "10001", "11111", "11111", "10001", "11111", "10001", "10001", "01110", "10000", "11111", "10001", "11111", "00100", "11111", "00100", "11111", "10001", "11111", "11111"}
};
vector code(26, "");
for (int row = 0; row < 9; row++) {
for (int col = 0; col < 26; col++) {
code[col] += A[row][col];
}
}
map mp;
for (char ch = 'A'; ch <= 'Z'; ch++) {
mp[code[ch - 'A']] = ch;
}
vector B;
for (string s; cin >> s; B.push_back(s));
for (int L = 0, R = 0; R < (int)B[0].size(); R++) {
int zeros = 0;
for (int row = 0; row < 9; row++) {
zeros += B[row][R] == '0';
}
if (zeros == 9) {
L = R + 1;
} else if (R - L + 1 == 5) {
string pl;
for (int row = 0; row < 9; row++) {
pl += B[row].substr(L, 5);
}
if (mp.count(pl)) {
cout << mp[pl];
}
L = R + 1;
}
}
return 0;
}
Matrix rotation
def rotate_layer(layer, pos, direction, odd_layer):
n = len(layer)
rotated_layer = [None] * n
if direction == "clockwise":
for i in range(n):
rotated_layer[(i + pos) % n] = layer[i]
else:
for i in range(n):
rotated_layer[(i - pos) % n] = layer[i]
for i in range(n):
if odd_layer:
rotated_layer[i] = chr(((ord(rotated_layer[i]) - ord('A') - 1) % 26) + ord('A'))
else:
rotated_layer[i] = chr(((ord(rotated_layer[i]) - ord('A') + 1) % 26) + ord('A'))
return rotated_layer
def adjust_query(plan, row, col, size):
layers = []
for layer in range(size // 2):
current_layer = []
for j in range(col + layer, col + size - layer):
current_layer.append(plan[row + layer][j])
for i in range(row + layer + 1, row + size - layer - 1):
current_layer.append(plan[i][col + size - layer - 1])
for j in range(col + size - layer - 1, col + layer - 1, -1):
current_layer.append(plan[row + size - layer - 1][j])
for i in range(row + size - layer - 2, row + layer, -1):
current_layer.append(plan[i][col + layer])
layers.append(current_layer)
for lidx, layer in enumerate(layers):
odd_layer = (lidx + 1) % 2 == 1
direction = "counterclockwise" if odd_layer else "clockwise"
pos = lidx + 1
rotated_layer = rotate_layer(layer, pos, direction, odd_layer)
idx = 0
for j in range(col + lidx, col + size - lidx):
plan[row + lidx][j] = rotated_layer[idx]
idx += 1
for i in range(row + lidx + 1, row + size - lidx - 1):
plan[i][col + size - lidx - 1] = rotated_layer[idx]
idx += 1
for j in range(col + size - lidx - 1, col + lidx - 1, -1):
plan[row + size - lidx - 1][j] = rotated_layer[idx]
idx += 1
for i in range(row + size - lidx - 2, row + lidx, -1):
plan[i][col + lidx] = rotated_layer[idx]
idx += 1
def perform_rotation(n, plan, queries):
for row, col, size in queries:
adjust_query(plan, row, col, size)
return ''.join(''.join(row) for row in plan)
n = int(input())
plan = [list(input().strip()) for _ in range(n)]
q = int(input())
queries = [tuple(map(int, input().split())) for _ in range(q)]
result = perform_rotation(n, plan, queries)
print(result, end="")
HELP RITIKA
import sys
import math
def get_max_prefix_length_and_deletions(sub_str, target_str, start_idx):
sub_idx, target_idx, match_length = 0, start_idx, 0
while sub_idx < len(sub_str) and target_idx < len(target_str):
if sub_str[sub_idx] == target_str[target_idx]:
match_length += 1
21 597
Count press
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
int dp(string& s, vector<string>& v, unordered_map<string, int>& memo) {
if (memo.count(s)) return memo[s];
int maxRemoval = 0;
for (auto& x : v) {
size_t pos = s.find(x);
if (pos != string::npos) {
string new_string = s.substr(0, pos) + s.substr(pos + x.size());
maxRemoval = max(maxRemoval, 1 + dp(new_string, v, memo));
}
}
return memo[s] = maxRemoval;
}
int main() {
int n;
cin >> n;
vector<string> substrings(n);
for (int i = 0; i < n; ++i) {
cin >> substrings[i];
}
string mainString;
cin >> mainString;
unordered_map<string, int> memo;
cout << dp(mainString, substrings, memo);
return 0;
}
FOLDER AREA
#include <iostream>
#include <cmath>
#include <set>
#include <iomanip>
#include <vector>
#include <utility>
using namespace std;
pair<double, double> reflectPoint(double px, double py, double x1, double y1, double x2, double y2) {
double A = y2 - y1;
double B = x1 - x2;
double C = x2 * y1 - x1 * y2;
double distance = (A * px + B * py + C) / sqrt(A * A + B * B);
double reflectedX = px - 2 * distance * (A / sqrt(A * A + B * B));
double reflectedY = py - 2 * distance * (B / sqrt(A * A + B * B));
return {reflectedX, reflectedY};
}
int main() {
double area;
cout << "Enter area of the square: ";
cin >> area;
double x1, y1, x2, y2;
cout << "Enter the coordinates of the line (x1 y1 x2 y2): ";
cin >> x1 >> y1 >> x2 >> y2;
double side = sqrt(area);
vector<pair<double, double>> corners = {
{0, 0},
{0, side},
{side, side},
{side, 0}
};
set<pair<double, double>> uniquePoints(corners.begin(), corners.end());
for (const auto& corner : corners) {
auto [rx, ry] = reflectPoint(corner.first, corner.second, x1, y1, x2, y2);
uniquePoints.insert({rx, ry});
}
for (const auto& point : uniquePoints) {
cout << fixed << setprecision(2) << point.first << " " << point.second << endl;
}
return 0;
}
Segment display
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<vector<string>> A = {
{"11111", "11111", "11111", "11111", "11111", "11111", "11111", "10001", "11111", "11111", "10001", "10000", "11111", "10001", "01110", "11111", "11111", "11111", "11111", "11111", "10001", "10001", "10001", "10001", "10001", "11111"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10000", "10001", "00100", "00001", "10010", "10000", "10101", "11001", "10001", "10001", "10001", "10001", "10000", "00100", "10001", "10001", "10001", "00000", "10001", "00000"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10000", "10001", "00100", "00001", "10100", "10000", "10101", "10101", "10001", "10001", "10001", "10001", "10000", "00100", "10001", "10001", "10001", "01010", "10001", "00010"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10000", "10001", "00100", "00001", "11000", "10000", "10101", "10011", "10001", "10001", "10001", "10001", "10000", "00100", "10001", "10001", "10001", "00000", "10001", "00000"},
{"11111", "11111", "10000", "10001", "11111", "11111", "10111", "11111", "00100", "10001", "11111", "10000", "10101", "10001", "10001", "11111", "10101", "11111", "11111", "00100", "10001", "10001", "10101", "00100", "11111", "00100"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10001", "10001", "00100", "10001", "10001", "10000", "10001", "10001", "10001", "10000", "10001", "11000", "00001", "00100", "10001", "10001", "10101", "00000", "00001", "00000"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10001", "10001", "00100", "10001", "10001", "10000", "10001", "10001", "10001", "10000", "10011", "10100", "00001", "00100", "10001", "10001", "10101", "01010", "00001", "01000"},
{"10001", "10001", "10000", "10001", "10000", "10000",
21 597
Count press
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
int dp(string& s, vector<string>& v, unordered_map<string, int>& memo) {
if (memo.count(s)) return memo[s];
int maxRemoval = 0;
for (auto& x : v) {
size_t pos = s.find(x);
if (pos != string::npos) {
string new_string = s.substr(0, pos) + s.substr(pos + x.size());
maxRemoval = max(maxRemoval, 1 + dp(new_string, v, memo));
}
}
return memo[s] = maxRemoval;
}
int main() {
int n;
cin >> n;
vector<string> substrings(n);
for (int i = 0; i < n; ++i) {
cin >> substrings[i];
}
string mainString;
cin >> mainString;
unordered_map<string, int> memo;
cout << dp(mainString, substrings, memo);
return 0;
}
FOLDER AREA
#include <iostream>
#include <cmath>
#include <set>
#include <iomanip>
#include <vector>
#include <utility>
using namespace std;
pair<double, double> reflectPoint(double px, double py, double x1, double y1, double x2, double y2) {
double A = y2 - y1;
double B = x1 - x2;
double C = x2 * y1 - x1 * y2;
double distance = (A * px + B * py + C) / sqrt(A * A + B * B);
double reflectedX = px - 2 * distance * (A / sqrt(A * A + B * B));
double reflectedY = py - 2 * distance * (B / sqrt(A * A + B * B));
return {reflectedX, reflectedY};
}
int main() {
double area;
cout << "Enter area of the square: ";
cin >> area;
double x1, y1, x2, y2;
cout << "Enter the coordinates of the line (x1 y1 x2 y2): ";
cin >> x1 >> y1 >> x2 >> y2;
double side = sqrt(area);
vector<pair<double, double>> corners = {
{0, 0},
{0, side},
{side, side},
{side, 0}
};
set<pair<double, double>> uniquePoints(corners.begin(), corners.end());
for (const auto& corner : corners) {
auto [rx, ry] = reflectPoint(corner.first, corner.second, x1, y1, x2, y2);
uniquePoints.insert({rx, ry});
}
for (const auto& point : uniquePoints) {
cout << fixed << setprecision(2) << point.first << " " << point.second << endl;
}
return 0;
}
Segment display
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<vector<string>> A = {
{"11111", "11111", "11111", "11111", "11111", "11111", "11111", "10001", "11111", "11111", "10001", "10000", "11111", "10001", "01110", "11111", "11111", "11111", "11111", "11111", "10001", "10001", "10001", "10001", "10001", "11111"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10000", "10001", "00100", "00001", "10010", "10000", "10101", "11001", "10001", "10001", "10001", "10001", "10000", "00100", "10001", "10001", "10001", "00000", "10001", "00000"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10000", "10001", "00100", "00001", "10100", "10000", "10101", "10101", "10001", "10001", "10001", "10001", "10000", "00100", "10001", "10001", "10001", "01010", "10001", "00010"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10000", "10001", "00100", "00001", "11000", "10000", "10101", "10011", "10001", "10001", "10001", "10001", "10000", "00100", "10001", "10001", "10001", "00000", "10001", "00000"},
{"11111", "11111", "10000", "10001", "11111", "11111", "10111", "11111", "00100", "10001", "11111", "10000", "10101", "10001", "10001", "11111", "10101", "11111", "11111", "00100", "10001", "10001", "10101", "00100", "11111", "00100"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10001", "10001", "00100", "10001", "10001", "10000", "10001", "10001", "10001", "10000", "10001", "11000", "00001", "00100", "10001", "10001", "10101", "00000", "00001", "00000"},
{"10001", "10001", "10000", "10001", "10000", "10000", "10001", "10001", "00100", "10001", "10001", "10000", "10001", "10001", "10001", "10000", "10011", "10100", "00001", "00100", "10001", "10001", "10101", "01010", "00001", "01000"},
{"10001", "10001", "10000", "10001", "10000", "10000",
21 597
) ** 2
start_section = end_section = None
for idx, section in enumerate(sections):
for row in section:
if 'S' in row:
start_section = idx
if 'D' in row:
end_section = idx
other_sections = [i for i in range(total_sections) if i not in {start_section, end_section}]
min_path = float('inf')
for perm in itertools.permutations(other_sections):
order = [start_section] + list(perm) + [end_section]
rebuilt_grid = rebuild_grid(order, sections, size, block_size)
min_path = min(min_path, shortest_path(rebuilt_grid, size))
return min_path
if name == "main":
print(main())
ALTERNATING STRING
import java.util.Scanner;
public class AlternatingStringProcessor {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String binaryString = scanner.nextLine();
int length = binaryString.length();
int[] values = new int[length];
for (int i = 0; i < length; i++) {
values[i] = scanner.nextInt();
}
int result = 0;
int currentDigit = binaryString.charAt(0) - '0';
int lastValue = values[0];
for (int i = 1; i < length; i++) {
int nextDigit = binaryString.charAt(i) - '0';
if (nextDigit == currentDigit) {
result += Math.min(lastValue, values[i]);
lastValue = Math.max(lastValue, values[i]);
} else {
currentDigit = nextDigit;
lastValue = values[i];
}
}
System.out.println(result);
}
}
TCS CodeVita
@itjobsservices
21 597
Company : NTT
Role : Intern
Qualification :Bachelor’s / Master’s
Batch : 2025 & 2026
Salary : Up to ₹ 6LPA
Experience : Fresher’s
Location : Bengaluru
Apply link : https://careers.services.global.ntt/global/en/job/NTT1GLOBALR121946EXTERNALENGLOBAL/Intern?utm_source=indeed&utm_medium=phenom-feeds
Company : Capgemini
Role : Deal Centre of Excellence
Qualification : Graduate/B Com/BAF
Batch : 2024 without any Active Backlogs
Salary : Up to ₹ 5 LPA
Experience : Fresher’s
Location : Mumbai
Apply link : https://www.capgemini.com/in-en/solutions/off-campus-drive-for-deal-centre-of-excellence-dcoe-2024-graduates/
21 597
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
int N = int.Parse(Console.ReadLine());
var graph = new Dictionary>();
var indegrees = new Dictionary();
for (int i = 0; i < N; i++)
{
var edge = Console.ReadLine().Split();
string from = edge[0];
string to = edge[1];
if (!graph.ContainsKey(from))
graph[from] = new List();
graph[from].Add(to);
if (!indegrees.ContainsKey(from))
indegrees[from] = 0;
if (!indegrees.ContainsKey(to))
indegrees[to] = 0;
indegrees[to]++;
}
var words = Console.ReadLine().Split();
var levels = new Dictionary();
var queue = new Queue();
foreach (var node in indegrees.Keys)
{
if (indegrees[node] == 0)
{
levels[node] = 1; // Root level is 1
queue.Enqueue(node);
}
}
while (queue.Count > 0)
{
var current = queue.Dequeue();
int currentLevel = levels[current];
if (graph.ContainsKey(current))
{
foreach (var neighbor in graph[current])
{
if (!levels.ContainsKey(neighbor))
{
levels[neighbor] = currentLevel + 1;
queue.Enqueue(neighbor);
}
indegrees[neighbor]--;
if (indegrees[neighbor] == 0 && !levels.ContainsKey(neighbor))
{
queue.Enqueue(neighbor);
}
}
}
}
int totalValue = 0;
foreach (var word in words)
{
if (levels.ContainsKey(word))
{
totalValue += levels[word];
}
else
{
totalValue += -1;
}
}
Console.Write(totalValue);
}
}
String Puzzle
C+
21 597
int main() {
string s;
cin >> s;
int n = s.length(), res = 0;
vector v(n);
for (int i = 0; i < n; ++i) cin >> v[i];
int lw = s[0] - '0', lwv = v[0];
for (int i = 1; i < n; ++i) {
if (s[i] - '0' == lw) {
res += min(lwv, v[i]);
lwv = max(lwv, v[i]);
} else {
lw = s[i] - '0';
lwv = v[i];
}
}
cout << res;
return 0;
}
Form alternating string
Change accordingly before submitting to avoid plagiarism
21 597
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int arr[n];
for(int i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
int count=0;
int num=arr[0];
for(int i=1;i<n;i++)
{
if(num!=arr[i])
count++;
}
printf("%d",count);
}
21 597
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
struct Line {
int x1, y1, x2, y2;
};
int countCells(Line line, pair<int, int> star, bool split) {
if (line.x1 == line.x2) {
if (split) {
return min(abs(star.second - line.y1), abs(star.second - line.y2)) + 1;
}
else {
return abs(line.y1 - line.y2) + 1;
}
}
else {
if (split) {
return min(abs(star.first - line.x1), abs(star.first - line.x2)) + 1;
}
else {
return abs(line.x1 - line.x2) + 1;
}
}
}
bool intersects(Line a, Line b, pair<int, int>& intersection) {
if (a.x1 == a.x2 && b.y1 == b.y2) {
if (b.x1 <= a.x1 && a.x1 <= b.x2 && a.y1 <= b.y1 && b.y1 <= a.y2) {
intersection = {a.x1, b.y1};
return true;
}
}
if (a.y1 == a.y2 && b.x1 == b.x2) {
if (a.x1 <= b.x1 && b.x1 <= a.x2 && b.y1 <= a.y1 && a.y1 <= b.y2) {
intersection = {b.x1, a.y1};
return true;
}
}
return false;
}
int main() {
int N, K;
cin >> N;
vector<Line> lines(N);
for (int i = 0; i < N; ++i) {
cin >> lines[i].x1 >> lines[i].y1 >> lines[i].x2 >> lines[i].y2;
if (lines[i].x1 > lines[i].x2 || (lines[i].x1 == lines[i].x2 && lines[i].y1 > lines[i].y2)) {
swap(lines[i].x1, lines[i].x2);
swap(lines[i].y1, lines[i].y2);
}
}
cin >> K;
map<pair<int, int>, vector<Line>> stars;
for (int i = 0; i < N; ++i) {
for (int j = i + 1; j < N; ++j) {
pair<int, int> intersection;
if (intersects(lines[i], lines[j], intersection)) {
stars[intersection].push_back(lines[i]);
stars[intersection].push_back(lines[j]);
}
}
}
int asiylam = 0;
for (auto& star : stars) {
if (star.second.size() / 2 == K) {
vector<int> intensities;
for (auto& line : star.second) {
intensities.push_back(countCells(line, star.first, true));
}
asiylam += *min_element(intensities.begin(), intensities.end());
}
}
cout << asiylam << endl;
return 0;
}
Magic Star Intensity Code
C++
TCS Exam
21 597
int main() {
int n, m, k, d = 1, rv = 0;
cin >> n >> m;
vector> f(n);
for (int i = 0, u, v; i < m; ++i) {
cin >> u >> v;
f[u].insert(v);
f[v].insert(u);
}
cin >> k;
vector w(n, true);
rv = n;
while (rv < k) {
vector nw(n, false);
for (int i = 0; i < n; ++i) {
int cnt = 0;
for (int fr : f[i]) cnt += w[fr];
if (w[i] && cnt == 3) nw[i] = true;
else if (!w[i] && cnt < 3) nw[i] = true;
}
w = nw;
rv += count(w.begin(), w.end(), true);
++d;
}
cout << d;
return 0;
}
Office Rostering
C+
TCS exam
21 597
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int arr[n];
for(int i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
int count=0;
int num=arr[0];
for(int i=1;i<n;i++)
{
if(num!=arr[i])
count++;
}
printf("%d",count);
}
C Language
TCS 1st Qsn
---------------------------------------------------------
N=int(input())
K=int(input())
price=list(map(int,input().split()))
vol=list(map(int,input().split()))
maxvol=0
volu=0
maxvol=max(vol)
for i in range(0,N):
if (maxvol==vol[i] and price[i]<=K):
K=K-price[i]
volu=maxvol
for i in range(0,N):
for j in range(i+1,N+1):
if (price[i]<=K and price[i]==price[j]):
if (vol[i]>vol[j]):
volu=volu+vol[i]
K=K-price[i]
else:
volu=volu+vol[j]
K=K-price[j]
elif (price[i]<=K and price[i]!=price[j]):
K=K-price[i]
-------
include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int arr[n];
for(int i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
int count=0;
int num=arr[0];
for(int i=1;i<n;i++)
{
if(num!=arr[i])
count++;
}
printf("%d",count);
}
Array Code in C language
21 597
Capstoneco Hiring
Summer Internship
Batch: 2025/2026
Location: London, New York
Duration: 10 Weeks
Apply now:- https://www.itjobs.services/2024/11/capstoneco-hiring.html
