# tutorial

**URL:** https://discuss.codechef.com/c/tutorial/6.md

[Latest](https://discuss.codechef.com/latest.md) · [Categories](https://discuss.codechef.com/categories.md) · [Tags](https://discuss.codechef.com/tags.md)

---

## [About the tutorial category](https://discuss.codechef.com/t/about-the-tutorial-category/28508)

<div class="topic-metadata">

**Author:** [@system](https://discuss.codechef.com/u/system)\
**Replies:** 0\
**Last updated:** [June 21, 2019, 6:40am UTC](https://discuss.codechef.com/t/about-the-tutorial-category/28508 "2019-06-21T06:40:39Z")

</div>

---

## [Help me in solving OPJA06 problem](https://discuss.codechef.com/t/help-me-in-solving-opja06-problem/118604)

<div class="topic-metadata">

**Author:** [@al\_4al21cg016](https://discuss.codechef.com/u/al_4al21cg016)\
**Replies:** 3\
**Last updated:** [September 27, 2026, 3:48pm UTC](https://discuss.codechef.com/t/help-me-in-solving-opja06-problem/118604 "2026-09-27T15:48:03Z")

</div>

My issue code please My code class BankAccount { private int accountNumber; private String accountHolder; private int balance; // Constructor to initialize the attributes public BankAccount(int acco…

---

## [Learning Geography Concepts Through Programming Projects and Practice](https://discuss.codechef.com/t/learning-geography-concepts-through-programming-projects-and-practice/124857)

<div class="topic-metadata">

**Author:** [@trip\_wolf\_27](https://discuss.codechef.com/u/trip_wolf_27)\
**Replies:** 0\
**Last updated:** [January 17, 2026, 11:20pm UTC](https://discuss.codechef.com/t/learning-geography-concepts-through-programming-projects-and-practice/124857 "2026-01-17T23:20:30Z")

</div>

Geography and computer programming can complement each other in meaningful ways. Many beginner programming projects involve working with structured data, such as lists of places, regions, or coordinates, which naturally …

---

## [Logic Behind this ques](https://discuss.codechef.com/t/logic-behind-this-ques/123471)

<div class="topic-metadata">

**Author:** [@darshan357](https://discuss.codechef.com/u/darshan357)\
**Replies:** 0\
**Last updated:** [May 13, 2025, 5:10am UTC](https://discuss.codechef.com/t/logic-behind-this-ques/123471 "2025-05-13T05:10:22Z")

</div>

In this question we are given a number and asked to print its Binary Equivalent. eg. 5 = 101, 2 = 10, etc. we can solve this using the method we use to find binary equivalent of any number on paper-pen, that is using d…

---

## [(Tutorial) Prefix Function + Pattern Matching (supposedly, KMP)](https://discuss.codechef.com/t/tutorial-prefix-function-pattern-matching-supposedly-kmp/67531)

<div class="topic-metadata">

**Author:** [@galencolin](https://discuss.codechef.com/u/galencolin)\
**Replies:** 11\
**Last updated:** [March 24, 2025, 10:31pm UTC](https://discuss.codechef.com/t/tutorial-prefix-function-pattern-matching-supposedly-kmp/67531 "2025-03-24T22:31:48Z")

</div>

As requested by @everule1 Quick info: |s| denotes the length of a string s I will use 0-indexing for strings, always A great article on this algorithm, from which I take my inspiration, is here Code is again in C++. A…

---

## [Help me in solving GSQ68E problem](https://discuss.codechef.com/t/help-me-in-solving-gsq68e-problem/122696)

<div class="topic-metadata">

**Author:** [@kl\_99230041053](https://discuss.codechef.com/u/kl_99230041053)\
**Replies:** 0\
**Last updated:** [February 12, 2025, 5:03am UTC](https://discuss.codechef.com/t/help-me-in-solving-gsq68e-problem/122696 "2025-02-12T05:03:40Z")

</div>

My issue but is showing wrong My code WITH top\_purchase AS ( SELECT Purchase\_id, Customer\_id, Purchase\_Amt FROM Purchase ORDER BY Purchase\_Amt DESC LIMIT 3 ) SELECT Customer.Customer\_id, Custom…

---

## [Practice issue in my process please verified it](https://discuss.codechef.com/t/practice-issue-in-my-process-please-verified-it/122469)

<div class="topic-metadata">

**Author:** [@raju4275](https://discuss.codechef.com/u/raju4275)\
**Replies:** 1\
**Last updated:** [January 29, 2025, 5:30am UTC](https://discuss.codechef.com/t/practice-issue-in-my-process-please-verified-it/122469 "2025-01-29T05:30:22Z")

</div>

there are issues in practice java please verified this

---

## [Help me in solving RCPITCP11 problem](https://discuss.codechef.com/t/help-me-in-solving-rcpitcp11-problem/121285)

<div class="topic-metadata">

**Author:** [@fit\_dust\_57](https://discuss.codechef.com/u/fit_dust_57)\
**Replies:** 2\
**Last updated:** [November 28, 2024, 9:42pm UTC](https://discuss.codechef.com/t/help-me-in-solving-rcpitcp11-problem/121285 "2024-11-28T21:42:35Z")

</div>

My issue What done My code #include\<stdio.h\> int main() { printf("%d",2+1); printf("%d",3+4); } Learning course: Learn C Programming Problem Link: https://www.codechef.com/learn/course/rcpit-programming-c/RC…

---

## [Help me in solving ADVPPY202 problem](https://discuss.codechef.com/t/help-me-in-solving-advppy202-problem/119451)

<div class="topic-metadata">

**Author:** [@kind\_zenith\_20](https://discuss.codechef.com/u/kind_zenith_20)\
**Replies:** 0\
**Last updated:** [August 16, 2024, 6:24am UTC](https://discuss.codechef.com/t/help-me-in-solving-advppy202-problem/119451 "2024-08-16T06:24:21Z")

</div>

My issue def find\_person\_with\_lowest\_age(): min\_age\_person = persons.persons\[0\] for person in persons.persons\[1:\]: if person\[‘age’\] \< min\_age\_person\[‘age’\]: min\_age\_person = person return min\_age\_person # Write you…

---

## [Input in java?](https://discuss.codechef.com/t/input-in-java/47630)

<div class="topic-metadata">

**Author:** [@aarrya](https://discuss.codechef.com/u/aarrya)\
**Replies:** 1\
**Last updated:** [December 24, 2019, 7:28am UTC](https://discuss.codechef.com/t/input-in-java/47630 "2019-12-24T07:28:48Z")

</div>

can someone please show the java code for how to take in inputs and how to print the outputs in the exact same format using Scanner?please i m unable to do that.i am used to a System.out.print(“enter number”); int number…

---

## [How to prepare for and ace the machine coding round? | Interview Tips](https://discuss.codechef.com/t/how-to-prepare-for-and-ace-the-machine-coding-round-interview-tips/38142)

<div class="topic-metadata">

**Author:** [@gc\_nit](https://discuss.codechef.com/u/gc_nit)\
**Replies:** 15\
**Last updated:** [July 16, 2024, 8:29pm UTC](https://discuss.codechef.com/t/how-to-prepare-for-and-ace-the-machine-coding-round-interview-tips/38142 "2024-07-16T20:29:31Z")

</div>

Machine Coding Round Given the recent popularity of machine coding round, most of the top tech companies in India (Flipkart, Uber, Swiggy, Ola, Cred, etc.) have started adopting it into their interview process. Since it…

---

## [Where is the Run button in C tutorial](https://discuss.codechef.com/t/where-is-the-run-button-in-c-tutorial/105450)

<div class="topic-metadata">

**Author:** [@rob1](https://discuss.codechef.com/u/rob1)\
**Replies:** 6\
**Last updated:** [May 28, 2024, 5:23am UTC](https://discuss.codechef.com/t/where-is-the-run-button-in-c-tutorial/105450 "2024-05-28T05:23:27Z")

</div>

Its telling me to Run for this tutorial, but cant find Run button, im I blind?

---

## [FENDITOGEL Bandar Situs Permainan Ceme Online Terbaru Bisa Depo Via Bank BCA](https://discuss.codechef.com/t/fenditogel-bandar-situs-permainan-ceme-online-terbaru-bisa-depo-via-bank-bca/117385)

<div class="topic-metadata">

**Author:** [@suaragitartuta](https://discuss.codechef.com/u/suaragitartuta)\
**Replies:** 0\
**Last updated:** [April 18, 2024, 11:50am UTC](https://discuss.codechef.com/t/fenditogel-bandar-situs-permainan-ceme-online-terbaru-bisa-depo-via-bank-bca/117385 "2024-04-18T11:50:26Z")

</div>

DAFTAR FENDITOGEL ! SAPA KAMI DI WA : 081378172369 CARI KAMI DI GOOGLE : FENDITOGEL,COM (ganti koma menjadi titik) Bandar situs ceme online adalah situs judi bandar ceme online terbaik dan terpercaya dapat anda datang…

---

## [More intuitive explanation for the harmonic series's sum](https://discuss.codechef.com/t/more-intuitive-explanation-for-the-harmonic-seriess-sum/67287)

<div class="topic-metadata">

**Author:** [@galencolin](https://discuss.codechef.com/u/galencolin)\
**Replies:** 7\
**Last updated:** [February 4, 2024, 6:59pm UTC](https://discuss.codechef.com/t/more-intuitive-explanation-for-the-harmonic-seriess-sum/67287 "2024-02-04T18:59:16Z")

</div>

Hey everyone! I want to talk about something that’s been bothering me for a while. It’s fairly well known that the sum of \\frac{n}{i}, 1 \\leq i \\leq n for any n (that is, \\sum\\limits\_{i=1}^n{\\frac{n}{i}}) is O(n\\log{n}).…

---

## [\[C++\] OOPS concepts](https://discuss.codechef.com/t/c-oops-concepts/74361)

<div class="topic-metadata">

**Author:** [@aneee004](https://discuss.codechef.com/u/aneee004)\
**Replies:** 19\
**Last updated:** [November 19, 2023, 6:06am UTC](https://discuss.codechef.com/t/c-oops-concepts/74361 "2023-11-19T06:06:29Z")

</div>

This blog covers some OOPS concepts, and some sample I/O covering the constructor call order. This is basically just my notes after reading about these concepts. I’m kinda saving it here, because CC has nice markdown, an…

---

## [Merge Sort Tree - Tutorial](https://discuss.codechef.com/t/merge-sort-tree-tutorial/14277)

<div class="topic-metadata">

**Author:** [@arunnsit](https://discuss.codechef.com/u/arunnsit)\
**Replies:** 35\
**Last updated:** [November 3, 2023, 12:51pm UTC](https://discuss.codechef.com/t/merge-sort-tree-tutorial/14277 "2023-11-03T12:51:07Z")

</div>

Prerequisites : Segment Trees Target Problem : Given an array of N elements and you have to answer Q queries of the form L R K , To Count the numbers smaller than K in range L to R. Key Idea : The key idea is to build …

---

## [Need someone to teach me coding in Minecraft - can DM me on Discord rudytz](https://discuss.codechef.com/t/need-someone-to-teach-me-coding-in-minecraft-can-dm-me-on-discord-rudytz/111357)

<div class="topic-metadata">

**Author:** [@doorenrudy](https://discuss.codechef.com/u/doorenrudy)\
**Replies:** 0\
**Last updated:** [September 6, 2023, 6:05pm UTC](https://discuss.codechef.com/t/need-someone-to-teach-me-coding-in-minecraft-can-dm-me-on-discord-rudytz/111357 "2023-09-06T18:05:20Z")

</div>

Any help will help!!!

---

## [MCQs about Time and Space Complexity Of a Program](https://discuss.codechef.com/t/mcqs-about-time-and-space-complexity-of-a-program/17976)

<div class="topic-metadata">

**Author:** [@admin](https://discuss.codechef.com/u/admin)\
**Replies:** 170\
**Last updated:** [August 12, 2023, 11:26am UTC](https://discuss.codechef.com/t/mcqs-about-time-and-space-complexity-of-a-program/17976 "2023-08-12T11:26:38Z")

</div>

Hi fellow programmers, We are trying to create a multiple choice quiz for space and time complexity of the programs related questions. Here are a set of 20 questions we collected. Please feel free to give your answers t…

---

## [\[Tutorial\] Formatting in CodeChef Discuss](https://discuss.codechef.com/t/tutorial-formatting-in-codechef-discuss/72834)

<div class="topic-metadata">

**Author:** [@aneee004](https://discuss.codechef.com/u/aneee004)\
**Replies:** 12\
**Last updated:** [July 22, 2020, 9:50pm UTC](https://discuss.codechef.com/t/tutorial-formatting-in-codechef-discuss/72834 "2020-07-22T21:50:38Z")

</div>

CodeChef has many beautiful Discuss Forum features. This tutorial is for introducing newcomers to the various formatting that are available in CC Discuss. I’ve seen individual tutorials on formatting code or equations, b…

---

## [Keyboard shortcuts](https://discuss.codechef.com/t/keyboard-shortcuts/106654)

<div class="topic-metadata">

**Author:** [@abhisekaero](https://discuss.codechef.com/u/abhisekaero)\
**Replies:** 1\
**Last updated:** [June 8, 2023, 1:56pm UTC](https://discuss.codechef.com/t/keyboard-shortcuts/106654 "2023-06-08T13:56:06Z")

</div>

Are there any keyboard shortcuts to “Run Code” and “Submit Code” in CodeChef IDE while practicing problems?

---

## [Java Collections Tutorial Part - 2](https://discuss.codechef.com/t/java-collections-tutorial-part-2/13327)

<div class="topic-metadata">

**Author:** [@kay\_kay](https://discuss.codechef.com/u/kay_kay)\
**Replies:** 3\
**Last updated:** [May 21, 2023, 11:45am UTC](https://discuss.codechef.com/t/java-collections-tutorial-part-2/13327 "2023-05-21T11:45:13Z")

</div>

In the previous tutorial, we have seen the introduction to JCF and Iterators. In this tutorial, lets look into the details of Collection Interfaces and Classes. THE COLLECTION INTERFACES The Collection Classes impleme…

---

## [Mirror of character in string](https://discuss.codechef.com/t/mirror-of-character-in-string/105071)

<div class="topic-metadata">

**Author:** [@vishnuchalla19](https://discuss.codechef.com/u/vishnuchalla19)\
**Replies:** 3\
**Last updated:** [April 29, 2023, 11:06am UTC](https://discuss.codechef.com/t/mirror-of-character-in-string/105071 "2023-04-29T11:06:05Z")

</div>

You are given a string A of length N consisting of only lowercase english letters. You need to generate B of length N which meets the following criteria – Each element of B is a lowercase english letter – Each element…

---

## [A Dance with Mobius Function](https://discuss.codechef.com/t/a-dance-with-mobius-function/11315)

<div class="topic-metadata">

**Author:** [@adurysk](https://discuss.codechef.com/u/adurysk)\
**Replies:** 5\
**Last updated:** [March 31, 2023, 11:06am UTC](https://discuss.codechef.com/t/a-dance-with-mobius-function/11315 "2023-03-31T11:06:37Z")

</div>

In this post I am going to share my little knowledge on how to solve some problems regarding Mobius Inversion Formula. I chose this topic because it has a lot of varieties of problems (mostly categorized as medium or har…

---

## [Codechef Rating](https://discuss.codechef.com/t/codechef-rating/101195)

<div class="topic-metadata">

**Author:** [@amanmishra1321](https://discuss.codechef.com/u/amanmishra1321)\
**Replies:** 3\
**Last updated:** [February 4, 2023, 7:37pm UTC](https://discuss.codechef.com/t/codechef-rating/101195 "2023-02-04T19:37:15Z")

</div>

How can I increase my rating. I have participated in rating contest multiple times (27 contests). and solved around 120 problems only on Codechef. Earlier I was on 2 star, but due to some important work I left a contest …

---

## [Getting Elementary/Middle Students Started and Certified](https://discuss.codechef.com/t/getting-elementary-middle-students-started-and-certified/104667)

<div class="topic-metadata">

**Author:** [@jegendron](https://discuss.codechef.com/u/jegendron)\
**Replies:** 1\
**Last updated:** [December 29, 2022, 9:34am UTC](https://discuss.codechef.com/t/getting-elementary-middle-students-started-and-certified/104667 "2022-12-29T09:34:18Z")

</div>

Hello everyone! I am a teacher for elementary/middle school students, and I have two brief questions: Does Codechef offer certificates they can hold onto? Any general suggestions on getting them started? (So far I …

---

## [How to practice for competitive programming?](https://discuss.codechef.com/t/how-to-practice-for-competitive-programming/96676)

<div class="topic-metadata">

**Author:** [@itsshahin](https://discuss.codechef.com/u/itsshahin)\
**Replies:** 1\
**Last updated:** [December 27, 2022, 9:08pm UTC](https://discuss.codechef.com/t/how-to-practice-for-competitive-programming/96676 "2022-12-27T21:08:19Z")

</div>

Just practice. Solve problems, solve problems and solve some more problems. By doing it, you will also learn new algorithms and techniques. Intro The writing that follows is intended for competitive programmers, but pr…

---

## [Error cehcking](https://discuss.codechef.com/t/error-cehcking/104453)

<div class="topic-metadata">

**Author:** [@kittu3082](https://discuss.codechef.com/u/kittu3082)\
**Replies:** 0\
**Last updated:** [December 12, 2022, 3:01pm UTC](https://discuss.codechef.com/t/error-cehcking/104453 "2022-12-12T15:01:41Z")

</div>

I have solution for the questions in the long challenge but I am getting error even logic is correct. contest name:- DEC221 Div 4 6th question Question code:- DIVISIBLEBY code:- T=int(input()) while T!=0: N=in…

---

## [Start your web development journey from this workshop](https://discuss.codechef.com/t/start-your-web-development-journey-from-this-workshop/104299)

<div class="topic-metadata">

**Author:** [@aaditya212](https://discuss.codechef.com/u/aaditya212)\
**Replies:** 0\
**Last updated:** [November 26, 2022, 10:25am UTC](https://discuss.codechef.com/t/start-your-web-development-journey-from-this-workshop/104299 "2022-11-26T10:25:55Z")

</div>

Build Twitter UI Clone with React JS :trophy::man\_technologist: Free Workshop on :spiral\_calendar: Date: 29 Nov 2022, :stopwatch: 07:00 PM Onwards What will you learn? - Code LIVE during the session Hands On WebApp…

---

## [Can anyone tell what is wrong in this code?](https://discuss.codechef.com/t/can-anyone-tell-what-is-wrong-in-this-code/104108)

<div class="topic-metadata">

**Author:** [@eitpw\_03](https://discuss.codechef.com/u/eitpw_03)\
**Replies:** 2\
**Last updated:** [November 18, 2022, 3:04am UTC](https://discuss.codechef.com/t/can-anyone-tell-what-is-wrong-in-this-code/104108 "2022-11-18T03:04:04Z")

</div>

problem code : CNDY I written a code and output matches with a given output but don’t understand how it shows wrong answer after submitting code. below is my code :slight\_smile: #include \<bits/stdc++.h\> using namespac…

---

## [Number theory course : youtube CodeNCode(2 Aug 2020 : Practice Problem added)](https://discuss.codechef.com/t/number-theory-course-youtube-codencode-2-aug-2020-practice-problem-added/51324)

<div class="topic-metadata">

**Author:** [@waqar\_ahmad224](https://discuss.codechef.com/u/waqar_ahmad224)\
**Replies:** 129\
**Last updated:** [October 5, 2022, 2:42pm UTC](https://discuss.codechef.com/t/number-theory-course-youtube-codencode-2-aug-2020-practice-problem-added/51324 "2022-10-05T14:42:44Z")

</div>

This is going to be a complete video lecture series on Number theory covering concepts in details with implementation details and practice problems to make concepts clear and gain confidence. here are the list of topics…

[Next page](https://discuss.codechef.com/c/tutorial/6.md?page=1)
