top of page
Coding Solutions is a great section for every coder. You can get answers to your programming questions here by the Team ATC. You can even ask for the answer to competitive programming language questions as well. First, search your question here, and if not found. Then, ask your question to Ask The Code members, and you will get your answer in no time from the members of this Indian Developer Community. Happy Coding.
Search
Tree - Find the smallest non-negative integer | AskTheCode
Tree...You are given a tree having A nodes numbered from 0 to A-1, rooted at node 0. Each node has a distinct value ranging between [0, A-1]
Team ATC
Jul 31, 20212 min read
61 views
0 comments


WAP to Implement Matrix Chain Multiplication in C - AskTheCode
Write a C program to display the required minimum number of multiplicative operations for multiplying the given matrices...
Team ATC
Jul 15, 20213 min read
37 views
0 comments
Dakimakura Distribition Codechef July Long Challenge Solution | AskTheCode
Only a few centuries later, the Berland government realized what was necessary for the country's prosperity. That's right, a dakimakura ...
Team ATC
Jul 5, 20213 min read
276 views
0 comments
Madoka and Ladder Decomposition - Codechef July Long Challenge Solution
Madoka was given a tree on her coming of age, and not a simple one, but a rooted tree of n vertices with a root at the vertex with number...
Team ATC
Jul 4, 202110 min read
284 views
0 comments
Even Odd Partition Codechef July Long Challenge Solution | AskTheCode
Let f(n) be the number of ways to partition the array [1,2,3,…,n] into contiguous sub-arrays such that every pair of adjacent sub-arrays ...
Team ATC
Jul 3, 20217 min read
282 views
0 comments
Chef and Pairs Codechef - July Long Challenge Solution in C++
You are given a tree (connected, undirected, acyclic graph) consisting of N nodes. Based on this tree, you have to answer Q queries ...
Team ATC
Jul 3, 20214 min read
519 views
0 comments
K Path Query - Codechef Solution | AskTheCode
You're given a tree with N vertices numbered from 1 to N. Your goal is to handle Q queries. For each query you are given K nodes v1,v2,…,vK.
Team ATC
Jul 2, 20213 min read
1,157 views
0 comments
XxOoRr - Codechef July Long Challenge Solution in C++ | AskTheCode
Given an array A1,A2…AN, find the minimum number of operations (possibly zero) required to convert all integers in A to 0...
Team ATC
Jul 2, 20212 min read
698 views
0 comments
Maximum Production - Codechef Solution in C++ | AskTheCode
Chefland has 7 days in a week. Chef is very conscious about his work done during the week. There are two ways he can spend his energy ...
Team ATC
Jul 2, 20212 min read
126 views
0 comments
Small Triangles Large Triangles - HackerRank Solution in C | AskTheCode
You are given n triangles, specifically their sides ai, bi & ci. Print them in the same style but sorted by their areas from the smallest...
Team ATC
Jun 30, 20212 min read
90 views
0 comments
A smallest number - June Circuits '21 HackerEarth solution | AskTheCode
You are given an integer K. Find the smallest number N such that N has exactly K digits and none of the digits in N is $$0$$. Also, ...
Team ATC
Jun 25, 20212 min read
108 views
0 comments
David is fighting Goliath (again) - MOOC assignment from Edx solution
Write a program that takes several lines of input from a user (see the below example). The first line of the input indicates the number ...
Team ATC
Jun 24, 20212 min read
66 views
0 comments
Too Much Xor Codechef Solution in C++| AskTheCode
Chef calls a sequence of integers A1,A2,…,ANgood if it satisfies the following conditions: In particular, any sequence with length 1... more
Team ATC
Jun 20, 20213 min read
155 views
0 comments
The Wave Codechef Solution in C++ | AskTheCode
Chef is stuck in the wavey world of polynomials. You are given all N roots of a polynomial P(x)=∏Ni=1(x−ai)...
Team ATC
Jun 20, 20211 min read
200 views
0 comments
Chefland Visa Codechef Solution - AskTheCode
Ash is trying to get visa to Chefland. For the visa to be approved, he needs to satisfy the following three criteria: Solve at least x1...
Team ATC
Jun 20, 20212 min read
124 views
0 comments
Shortest Route Codechef Solution | AskTheCode
There are N cities in Chefland numbered from 1 to N and every city has a railway station. Some cities have a train and each city... more
Team ATC
Jun 8, 20213 min read
831 views
2 comments
Bitwise Tuples - Codechef Solution -| AskTheCode
Chef has two numbers N and M. Help Chef to find number of integer N-tuples (A1,A2,…,AN) such that 0≤A1,A2,…,AN≤2M−1 and A1&A2&…&AN=0... more
Team ATC
Jun 8, 20212 min read
917 views
0 comments
Bella ciao - Codechef Solution | AskTheCode
Chef is planning a heist in the reserve bank of Chefland. They are planning to hijack the bank for D days and print the money...more
Team ATC
Jun 6, 20212 min read
1,186 views
1 comment
Summer Heat Codechef Solution in C++ and Java - AskTheCode
Chefland has 2 different types of coconut, type A and type B. Type A contains only xa milliliters of coconut water and type B contains...
Team ATC
Jun 6, 20212 min read
292 views
0 comments
Simple calculator program in c++ using functions & do-while loop - AskTheCode
Simple calculator program in c++ using functions...Write a simple calculator program in C++ for basic computations...
Team ATC
May 12, 20212 min read
122 views
0 comments
bottom of page