'Coding has over 700 languages', '67% of programming jobs aren’t in the technology industry', 'Coding is behind almost everything that is powered by electricity'
Coding Ninjas Studio contest
lightning-red
Rated
Weekend Contest 103
+30799 other showed interest
Contest ended
( IST)
Your rating & Leaderboard
Discussion
Video SolutionNew
Contest details
Rewards
Rules & FAQs
Login to view weekly contest rating
Weekly contest rating
Contest attended
Problems solved
2021 2024
Better than %
Contest leaderboard rules
EXP-Based Ranking:
Your leaderboard rank is influenced by your total EXP, which you accumulate by solving each question. The more EXP you gather, the higher your rank ascends.
Tie-Breaker Rule:
Should there be a tie in total EXP among participants, precedence is granted to the one who reached their total EXP first. This ensures a fair and competitive ranking.
Time Calculation:
The duration for accumulating EXP is measured from the contest's official start time. This ensures uniformity, as it does not depend on each participant’s start time.
Discussion
Go to discussion page
profile
Codestudio
Weekend Contest 103
Contests and hackathons
views
18496
views
chat
36
replies
upvote
8
upvotes

Hey Ninjas!

This is a post to ask doubts and share your logic for solving questions from Weekend Contest 103! 😄
You can also view the rankings for the contest here (link).

If you face any issues during the contest, do let us know by replying below. ✌️

How was your experience in the contest or got any feedback? Let us know here (link)

upvote
8 Upvoted
Published on 9 Dec, 2023
Replies (36)
profile
Praman Singh Tomar
9 Dec, 2023

Question 3 Gang 👀👀

chat
0
replies
upvote
3
upvotes
reply
Reply
profile
vishal_0719
9 Dec, 2023

Here are my solutions to question 1, 2 and 4.

Couldn't solve question 3. If anyone know the intuition please share.

 

Problem1:

 

vector<int> goodnessOfArray(int n, int m, vector<int>& a, vector<int>& b) {
    vector<int> ans;

    for(int i = 0; i < n; i++) {
        int goodness = 0;
        for(int j = 0; j < m; j++) {
            goodness = max(goodness, a[i] % b[j]);
        }
        ans.push_back(goodness);
    }

    return ans;
}

 

Problem2:

 

int findHiddenElement(int n, vector<int> &b) {
    vector<int> freq(n + 1, 0);
    if(b[0] != -1)
        freq[b[0]] = 1;

    // Since the numbers are from [1, N], find all the available elements
    // Extract available elements by (b[i] - b[i - 1]), excepts when we encounter -1
    for(int i = 1; i < n; i++) {
        if(b[i] == -1 || b[i - 1] == -1)
            continue;

        freq[b[i] - b[i - 1]] = 1;
    }

    // Traverse the frequency array and find the missing element
    int missing = 0;
    for(int i = 1; i <= n; i++) {
        if(freq[i] == 0) {
            missing = i;
            break;
        }
    }

    // Start from index 1 as index 0 won't have previous element
    // If -1 is encountered, the missing element is found by adding b[i - 1](previous sum) to it
    for(int i = 1; i < n; i++) {
        if(b[i] == -1)
            return b[i - 1] + missing;
    }

    // When -1 is at 0th index
    return missing;
}

 

Problem4:

 

int maxInSubMatrix(vector<vector<int>> &a, int x1, int y1, int x2, int y2) {
    int maxi = a[x1][y1];

    for(int i = x1; i <= x2; i++) {
        for(int j = y1; j <= y2; j++) {
            maxi = max(maxi, a[i][j]);
        }
    }

    return maxi;
}

vector<vector<int>> maximumInMatrices(int n, int m, int r, int s,
    vector<vector<int>> &a) {
        vector<vector<int>> ans(n, vector<int>(m));

        for(int i = 0; i < n; i++) {
            for(int j = 0; j < m; j++) {
                int x1 = i, y1 = j;
                int x2 = min(i + r - 1, n - 1), y2 = min(j + s - 1, m - 1);
                ans[i][j] = maxInSubMatrix(a, x1, y1, x2, y2); 
            }
        }

        return ans;
}
chat
3
replies
upvote
1
upvotes
reply
Reply
profile
abhisheik
9 Dec, 2023

i have completely solved a problem, and gained EXPs but still it show my problem solved as 0.. is this usual ?

chat
0
replies
upvote
2
upvotes
reply
Reply
profile
Vaibhav Gupta
9 Dec, 2023

my code is right but i dont pass some test cases in ques 3 what about in ques 3

 

chat
0
replies
upvote
2
upvotes
reply
Reply
profile
Pranay2799
12 Dec, 2023

It's already been 3 days but I didn't receive any mail regarding further screening rounds. I got  a percentile of 97.8 and I hope this is not a promotional act to attract multiple students. Not only this time but for the last one also I got above 95 percentile but haven't received any mail.

 

chat
1
replies
upvote
1
upvotes
reply
Reply
Video solution
Contest details

Are you ready to crack your chance to get your first tech Job? 

 

Join this Coding Ninjas Studio Weekend Contest 103 and celebrate the coding spirit.

Get a chance to secure a dream opportunity with Weekend Contest 103 Hiring Partners:

 

Internship & Job opportunity with Finanvo.in

 

Role: Full stack Web Dev ( Intern + PPO) - (Grad Year 2023)
Role:
Full stack Web Dev (FT) (Grad Year 2023 & Below)

 

Job opportunity with PayGlocal (2+ years experience required):


Role: Front End Dev (FT) - (Grad Year 2021 & Below)

 

Internship & Job opportunity with TruScholar:

 

Role:Full stack developer intern - (Grad Year 2023,2024)

Role: Full stack developer (FT) - (Grad Year 2023 & Below)

 


Note: Eligible candidates scoring above 50 percentile in the contest and fulfilling prerequisite as per the offered role requirements will receive further screening detail collection form within next 72 hrs of Weekend Contest from Coding Ninjas

Final Leaderboard will be displayed after 24 hours of the contest gets over. 

Contest Solution: Weekend Contest 103 Video Solution will be available on 11 Dec 2023 in Video Solution Section of the contest and CN Youtube Channel, stay tuned !!


Why Participate?

Earn Redeemable Gold Points: Participating and achieving place in top percentile in our weekend contest will earn you valuable redeemable Gold Points  These points enable you to redeem exciting rewards such as Coding Ninjas official merchandise, bags, smartwatches, and much more from CN Shopify store. It's your chance to showcase your skills while reaping fantastic benefits.

 

Enhance Your Skills: Our contest is designed to challenge and push you beyond your limits. By participating, you'll sharpen your problem-solving abilities, refine your coding techniques, and improve your overall algorithmic knowledge. It's the perfect opportunity to grow as a coder.

 



Sample problem for you
Rewards

Win Rewards Based on Your Percentile through earned Gold Points!

Do you know? 

Participating and achieving place in top percentile in our weekend contest will earn you valuable Gold Points 


These points enable you to redeem exciting rewards such as Smartwatch, headphone,Boat Airpodes, Fujifilm Camera,Coding Ninjas official merchandise and much more from CN Shopify store. It's your chance to showcase your skills while reaping fantastic benefits.

Reward Table:

Top 1%: Claim an impressive 50 Gold points!

Top 2 - 5%: Earn 25 Gold points for your outstanding performance.

Top 6 - 10%: Get 15 Gold points as a recognition of your skills.

Top 11 - 50%: Secure 5 Gold Points for showcasing your talent.

 

Also, You can earn Coding Ninjas Studio EXP as well to unlock lucrative badges on your CNStudio Profile

  • 1st - 1000 EXP
  • 2nd - 750 EXP
  • 3rd - 500 EXP
  • 4th-10th - 250 EXP
  • 11th-50th - 100 EXP
  • First Contest - 200 EXP
  • Participation - 100 EXP
Rules
  • You can submit solutions as many times as you'd like, there are no penalties for incorrect submissions. Only your best correct submission will be considered.
  • Those who achieve the score first will be placed higher in the ranklist in case of a tie.
  • Discussing Coding Ninjas Studio contest problems or any aspect of the problem, on any other platform on the web, on identification, could lead to disabling of respective account and banning from the community.
  • Please do not discuss strategy, suggestions, or tips in the comments during a live contest. Posting questions clarifying the problem statement is ok. If you are unsure, feel free email us at support@codingninjas.com
  • The problems will be partially graded. You will get score for passing certain test cases.
  • Facing any kind of issues, email us at support@codingninjas.com
For any issues and inquiries mail us at
support@codingninjas.com
FAQs
Which browser should I prefer to use to participate in contests?
What kind of questions can I expect in Coding Ninjas Studio contests?
Can I leave the test in the middle and continue later?
What if i encounter technical issues during the test?
What is the meaning of EXP?
Can we participate in contests from mobile?
Will I receive the results of the contest? If yes, when?
Will I get the allotted time to attempt the contest if I start the contest just few mins before the event End Time?